/var
/www
/vhosts
/grdar.cloud
/tcasertec.es
/core
/vendor
/grdar
/core
/src
/Views
/View.php
$container = Container::getInstance();
return get_object_vars($container);
}
public static function html()
{
isset(self::$vars) ? $this->isArray() : false;
self::getInstance();
ob_start();
echo '
<!doctype html>
<html lang="' . idioma() . '">';
require self::INCLUDES . 'head.php';
echo '<body>';
require self::INCLUDES . 'header.php';
require self::VIEWS . self::$template . '.php';
require self::INCLUDES . 'footer.php';
echo '</body>
</html>';
self::$templateContent = ob_get_clean();
}
public static function view($template, $vars = null)
{
self::$template = $template;
self::$vars = $vars;
self::html();
return self::$templateContent;
}
public function abort404($message)
{
http_response_code(404);
view('404');
exit();
/var
/www
/vhosts
/grdar.cloud
/tcasertec.es
/core
/vendor
/grdar
/core
/src
/Views
/View.php
$container = Container::getInstance();
return get_object_vars($container);
}
public static function html()
{
isset(self::$vars) ? $this->isArray() : false;
self::getInstance();
ob_start();
echo '
<!doctype html>
<html lang="' . idioma() . '">';
require self::INCLUDES . 'head.php';
echo '<body>';
require self::INCLUDES . 'header.php';
require self::VIEWS . self::$template . '.php';
require self::INCLUDES . 'footer.php';
echo '</body>
</html>';
self::$templateContent = ob_get_clean();
}
public static function view($template, $vars = null)
{
self::$template = $template;
self::$vars = $vars;
self::html();
return self::$templateContent;
}
public function abort404($message)
{
http_response_code(404);
view('404');
exit();
/var
/www
/vhosts
/grdar.cloud
/tcasertec.es
/core
/vendor
/grdar
/core
/src
/Views
/View.php
echo '
<!doctype html>
<html lang="' . idioma() . '">';
require self::INCLUDES . 'head.php';
echo '<body>';
require self::INCLUDES . 'header.php';
require self::VIEWS . self::$template . '.php';
require self::INCLUDES . 'footer.php';
echo '</body>
</html>';
self::$templateContent = ob_get_clean();
}
public static function view($template, $vars = null)
{
self::$template = $template;
self::$vars = $vars;
self::html();
return self::$templateContent;
}
public function abort404($message)
{
http_response_code(404);
view('404');
exit();
}
}
/var
/www
/vhosts
/grdar.cloud
/tcasertec.es
/core
/vendor
/grdar
/core
/src
/Routes
/Router.php
public function sendResponse($response)
{
if (is_string($response))
{
echo $response;
}
else if (is_array($response))
{
echo json_encode($response);
}
else if ($response instanceof Response)
{
$response->execute();
}
else
{
header("HTTP/1.0 404 Not Found");
$_REQUEST['page'] = '404';
exit(View::view('404'));
}
}
}
/var
/www
/vhosts
/grdar.cloud
/tcasertec.es
/core
/vendor
/grdar
/core
/src
/Routes
/Router.php
{
$route = new Route($uri, $closure);
array_push($this->routes, $route);
}
public function run()
{
$response = false;
$requestUri = $this->getRequestUri();
foreach ($this->routes as $route)
{
if ($route->checkIfMatch($requestUri))
{
$response = $route->execute();
// break para no seguir dando vueltas
// Ya se encontró la ruta correspondiente
break;
}
}
$this->sendResponse($response);
}
public function sendResponse($response)
{
if (is_string($response))
{
echo $response;
}
else if (is_array($response))
{
echo json_encode($response);
}
else if ($response instanceof Response)
{
$response->execute();
}
else
{
header("HTTP/1.0 404 Not Found");
/var
/www
/vhosts
/grdar.cloud
/tcasertec.es
/core
/vendor
/grdar
/core
/src
/Facades
/Facade.php
{
return static::$container;
}
public static function getAccessor()
{
throw new Exception('Please define the getAccessor method in your facade');
}
public static function getInstance()
{
return static::getContainer()->make(static::getAccessor());
}
public static function __callStatic($method, $args)
{
$object = static::getInstance();
switch (count($args)) {
case 0:
return $object->$method();
case 1:
return $object->$method($args[0]);
case 2:
return $object->$method($args[0], $args[1]);
case 3:
return $object->$method($args[0], $args[1], $args[2]);
default:
return call_user_func_array(array($object, $method), $args);
}
}
}
/var
/www
/vhosts
/grdar.cloud
/tcasertec.es
/index.php
// Rutas AJAX
//Rout::add('/ajax/logout', 'Ajax::logOut');
Rout::add('/ajax/add-contacto', 'Ajax::AddContacto');
//TODO Hacerlo automaticon con la tabla seo_paginas
// Rutas aplicación
Rout::add('/:lang/404', 'Index::p404');
Rout::add('/:lang', 'Index::index');
Rout::add('/:lang/' . PATHS_APP['Proyectos'][$idioma]["url"], 'Index::proyectos');
Rout::add('/:lang/' . PATHS_APP['Proyectos'][$idioma]["url"].'/:proyecto', 'Index::proyectoficha');
Rout::add('/:lang/' . PATHS_APP['Cookies'][$idioma]["url"], 'Index::cookies');
Rout::run();
ob_end_flush();