我使用的是PHP 5.4.15,MS windows Pro 64位,apache 2.4和Symfony 2.2。我有一个Symfony项目,使用注解,有时注解就是不起作用。我还发现Symfony使用ReflectionProperty::getDocComment()来获取注释,用于注释目的。让注解生效的唯一方法是以特定的顺序(排列)移动类字段,并且ReflectionProperty::getDocComment()不会返回false。
路由(“/)不起作用。 我已经尝试用Composer重新安装注解和Symfony了。App\Controller\ArticleController::homepage 我的ArticleController.php: namespace App\Controller;
use Symfony\Component\Routing\Annotation\Route;
class ArticleCo
* Another business rules here return array();}
然后,如果我调用"/api/country",Symfony2将调用BaseController的"/api/{entity_name}"路由,而不是被覆盖的路由CountryController的"/api/country"。
我正在开发一个Symfony 2.7项目,如果用户的会话过期,我希望将用户重定向到特定的页面。我创建了一个侦听器来检查角色和路由,如果用户试图在未经过身份验证的情况下访问经过身份验证的路由,我会重定向到特定的页面。这暂时不起作用,因为默认重定向到主页具有更高的优先级。这是监听程序:use Symfony\Component\HttpKernel\Event\GetResponseEvent;
u