0
http://docs.phalconphp.com/en/0.6.0/reference/session.html文檔有錯誤,我不知道
存儲/ Session中
檢索數據從一個控制器,一個視圖或任何其他成分,多數民衆贊成延伸爾康\ DI \注射就可以訪問會話服務並以下列方式存儲物品並將其檢索:
<?php
class UserController extends Phalcon\Mvc\Controller
{
public function indexAction()
{
//Set a session variable
$this->session->set("user-name", "Michael");
}
public function welcomeAction()
{
//Check if the variable is defined
if ($this->session->has("user-name")) {
//Retrieve its value
$name = $this->session->set("user-name"); //here, set or get?
}
}
}