echo Phalcon\Version::get();
get phalcon version
$id = $this->dispatcher->getParam("id");
$id = $this->request->get('id');
$id = $this->request->getPost('id');
$this->view->setTemplateBefore('public'); $this->view->disable(); $this->view->pick("item/close_window"); $this->view->title = "Title"; $this->view->setVar("title","Title");
{{ post.title }}
Get url
{{ router.getRewriteUri() }}
return $this->response->redirect($this->request->getHTTPReferer());
return $this->response->redirect("contact/index");
redirect to another controller action
$this->dispatcher->forward(['action' => 'index']);
$this->flash->error("too bad! the form had errors");
$this->flash->success("yes!, everything went very smoothly");
$this->flash->notice("this a very important information");
$this->flash->warning("best check yo self, you're not looking too good.");
$this->flash->message("debug", "this is debug message, you don't say");
$this->flashSession()->getMessages();
{{ this.flashSession.output() }}
use Phalcon\Flash\Direct as FlashDirect;
// Register the flash service with custom CSS classes
$di->set(
"flash",
function () {
$flash = new FlashDirect(
[
"error" => "alert alert-danger",
"success" => "alert alert-success",
"notice" => "alert alert-info",
"warning" => "alert alert-warning",
]
);
return $flash;
}
);