symfony - Symfony2: Custom 404 error for NotFoundHttpException -
so far, "twigbundle" custom error404.html.twig page displays correctly on production mode when throw:
$this->createnotfoundexception('whatevs');
however, when "notfoundhttpexception" thrown symfony (such whenever route not found), "no route found" page displays indeed on app_dev, mentioning "404 not found", on production mode displays blank page...
which not seem normal since, according symfony documentation: "the createnotfoundexception() method creates special notfoundhttpexception object, triggers 404 http response inside symfony."
then why don't same behavior? there missing?
i using master branch.
edit: here security.yml file, using fosuserbundle , fosfacebookbundle:
security: providers: chain_provider: chain: providers: [fos_userbundle, my_fos_facebook_provider] fos_userbundle: id: fos_user.user_manager my_fos_facebook_provider: id: my.facebook.user encoders: "fos\userbundle\model\userinterface": sha512 firewalls: public: pattern: ^/ fos_facebook: app_url: "http://apps.facebook.com/***/" server_url: "http://localhost/facebookapp/" login_path: /login check_path: /checkfb default_target_path: / provider: chain_provider form_login: login_path: /login check_path: /login_check provider: chain_provider remember_me: true csrf_provider: form.csrf_provider remember_me: key: %secret% anonymous: true logout: true login: pattern: ^/(login$|register|resetting) anonymous: true role_hierarchy: role_admin: role_admin role_super_admin: [role_admin, role_aloow_to_switch] role_user: role_user access_control: - { path: ^/, role: [is_authenticated_anonymously] } - { path: ^/secured/, role: [is_authenticated_fully] } # route secured fos_facebook - { path: ^/facebook/, role: [role_facebook] }
had same problem. see https://github.com/symfony/symfony/issues/5320 you're calling is_granted on errorpage or layout.html.twig. read answer of stof how solve this.
Comments
Post a Comment