本文整理匯總了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');
}
示例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"));
}
}
示例3: initalize
public function initalize()
{
parent::initalize();
}