本文整理汇总了PHP中helpers\Session::start方法的典型用法代码示例。如果您正苦于以下问题:PHP Session::start方法的具体用法?PHP Session::start怎么用?PHP Session::start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helpers\Session
的用法示例。
在下文中一共展示了Session::start方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Método responsável por obter o nome do controlador e do método e executá-los.
* @access public
* @return void
*/
public static function run()
{
ob_start();
//pega o controller na URL
Request::run();
Session::start();
$controller = Request::getCompleteController();
//verifica se o controlador existe
if (file_exists(PATH_CONTROLLER . $controller . '.php')) {
//instancia o controlador
$controlador = NAMESPACE_CONTROLLER . "\\" . $controller;
$controlador = new $controlador();
//pega o metodo da URL
$action = Request::getAction();
//Transforma o resto da URL em Array
$args = (array) Request::getArgs();
//verifica se o metodo existe no controlador
$post = self::VerificaMetodo($controlador, $action);
} else {
Request::InverseArea();
$area = Request::getArea();
$controller = Request::getCompleteController();
if (file_exists(PATH_AREA . $area . DS . 'Controllers' . DS . $controller . '.php')) {
//instancia o controlador
$controlador = NAMESPACE_AREAS . "\\" . $area . "\\Controllers\\" . $controller;
$controlador = new $controlador();
//pega o metodo da URL
$action = Request::getAction();
//Transforma o resto da URL em Array
$args = (array) Request::getArgs();
$post = self::VerificaMetodo($controlador, $action);
} else {
if (file_exists(PATH_CONTROLLER . CONTROLLER_404 . '.php')) {
Request::setController(CONTROLLER_404);
Request::setAction(ACTION_404);
Request::setArea(null);
$controlador = NAMESPACE_CONTROLLER . '\\' . CONTROLLER_404;
$controlador = new $controlador();
$action = ACTION_404;
//Transforma o resto da URL em Array
$args = (array) Request::getArgs();
$post = self::VerificaMetodo($controlador, $action);
}
}
}
self::getPost($args);
// try {
call_user_func_array(array($controlador, $action . $post), $args);
// }catch (\Exception $e){
// echo $e->getMessage();
// }
$content = ob_get_clean();
Layout::render($content);
}