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


PHP ControllerBase::initalize方法代碼示例

本文整理匯總了PHP中ControllerBase::initalize方法的典型用法代碼示例。如果您正苦於以下問題:PHP ControllerBase::initalize方法的具體用法?PHP ControllerBase::initalize怎麽用?PHP ControllerBase::initalize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ControllerBase的用法示例。


在下文中一共展示了ControllerBase::initalize方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: indexAction

 public function indexAction()
 {
     parent::initalize();
     //echo (new \Phalcon\Debug\Dump())->variable($this,'this');
     //echo (new \Phalcon\Debug\Dump())->variable($this->request,'request');
     //echo (new \Phalcon\Debug\Dump())->variable($this->view,'view');
     $this->view->router = json_encode($this->router);
     echo $this->view->render('index/index');
 }
開發者ID:jstacoder,項目名稱:phlaskr-phalcon,代碼行數:9,代碼來源:IndexController.php

示例2: registerAction

 public function registerAction()
 {
     parent::initalize();
     //echo '<link rel=stylesheet href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" />';
     $user = new Users();
     if ($this->request0 > isPost() && $this->request->getPost('password') == $this->request->getPost('confirm')) {
         $user->name = $this->request->getPost('name');
         $user->email = $this->request->getPost('email');
         $user->setPassword($this->request->getPost('password'));
         $success = $user->save();
         if ($success) {
             echo $this->flash->success("Thanks for registering {$user->email}");
         } else {
             echo $this->flash->error("error");
             foreach ($user->getMessages() as $msg) {
                 echo $this->flash->error($msg);
             }
         }
         $this->dispatcher->forward(array("controller" => "signup", "action" => "index"));
     }
 }
開發者ID:jstacoder,項目名稱:phlaskr-phalcon,代碼行數:21,代碼來源:SignupController.php

示例3: initalize

 public function initalize()
 {
     parent::initalize();
 }
開發者ID:jstacoder,項目名稱:phlaskr-phalcon,代碼行數:4,代碼來源:LoginController.php


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