本文整理汇总了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();
}