當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Session::start方法代碼示例

本文整理匯總了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);
 }
開發者ID:gmalaquias,項目名稱:alcatraz-mvc,代碼行數:59,代碼來源:Router.php


注:本文中的helpers\Session::start方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。