我這樣寫回報錯,不知道你們怎么判斷的<?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如何判斷登錄狀態,不可能每個方法都獲取session判斷吧
weibo_木木彡615_03308630
2016-05-07 16:28:53