我這樣寫回報(bào)錯(cuò),不知道你們?cè)趺磁袛嗟?lt;?phpnamespace Acme\DemoBundle\Controller;use Symfony\Bundle\FrameworkBundle\Controller\Controller;use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;use Symfony\Component\HttpFoundation\Response;class CommonController extends Controller{ function __construct(){ $session = $this->getRequest()->getSession(); $session->set("test", "test"); echo $session->get('test'); } /** * @Route("/test") */ public function indexAction(){ return new Response("hello test"); } }
symfony2如何判斷登錄狀態(tài),不可能每個(gè)方法都獲取session判斷吧
weibo_木木彡615_03308630
2016-05-07 16:28:53