symfony 构造函数问题
<?php namespace AppBundle\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; class BaseController extends Controller { public function __construct(Request $request) { if($request->getSession()->get('userid')){ echo 'yes'; }else{ return $this->redirect($this->generateUrl('login')); } // echo 'aaasss'; } }
想在构造方法里判断登录状态,symfony不支持?报错啊