本文整理匯總了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);
}