我这样写回报错,不知道你们怎么判断的
<?php
namespace 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");
}
}
梦是蓝的
wanka