Rendering of a template exception - symfony

I installed SonataClassificationBundle and extend it on my App\Application folder. The documentation on the official website isn't clear Classification Bundle
I corrected all namespaces to point into my extended bundle. I cleared the cache without error and I run the server.
When I log into the profile, I get this exception :
An exception has been thrown during the rendering of a template ("Unable to generate a URL for the named route "admin_app_sonataclassificationcategory_create" as such route does not exist.").
There is my sonata_classification:
sonata_classification:
class:
category: App\Application\Sonata\ClassificationBundle\Entity\Category
collection: App\Application\Sonata\ClassificationBundle\Entity\Collection
context: App\Application\Sonata\ClassificationBundle\Entity\Context
tag: App\Application\Sonata\ClassificationBundle\Entity\Tag
I detected the same problem with SonataUserBundle, but after promoting my user to ROLE_ADMIN, the problem was solved.
Can someone help?
Thank you

Solved again.
I just run :
composer update

Related

Unable to generate a URL for the named route "clone"

I am following the instructions at https://symfony.com/doc/2.x/bundles/SonataAdminBundle/cookbook/recipe_custom_action.html to build a custom CRUDController in a Symfony/Sonata application.
When I look at the list view, I get the following error message:
An exception has been thrown during the rendering of a template
("Unable to generate a URL for the named route "clone" as such route
does not exist.").
Is there additional code needed in order to get the application to recognize my new route?
Ah -- I had to put my configureRoutes() definition in the admin class rather than the controller class. The documentation was wrong.

in-vendor bundle controller autoload for use annotation

I have a problem with my project, I can't load my controller in my CoreBundle, but I manage it with Composer for updating easily in production server.
All code is on my github : https://github.com/super-vizor.
Supervizor (the main app) call CoreBundle by composer, but after update, during cache clear process, it gives an error:
"The file "../Controller" does not exist (in:
D:\Supervizor\supervizor\vendor\super-vizor\corebundle\DependencyInjection/../Resources/config)."
Why am I getting this error? How can I load my controller ?
Thanks for the response in advance and sorry for my English I'm French.

An exception has been thrown during the rendering?

i want to get the "PublisherId" from my twig file.
it returns me an error ----An exception has been thrown during the rendering of a template ("Unable to generate a URL for the named route "myBundle_publisher" as such route does not exist.")
I read the twig documentation and there it also write like how i write it.
Do anyone knows how i can solve this problem . Really stack here, can someone solve this problem, thanks in advanced.
The routes need to be imported to be active as any other routing resources (note the annotation type):
# import routes from a controller class
post:
resource: "#SensioBlogBundle/Controller/PostController.php"
type: annotation
More information about #Route

Symfony2 routing & twig

I need to include href to profile/edit in my view. Template engine is twig, so code look like this:
Edit profile
But i get exception:
An exception has been thrown during the rendering of a template ("Unable to generate a URL for the named route "fos_user_profile" as such route does not exist.") in VputiUserBundle:ProfileShow:show.html.twig at line 4.
Please help, where is mistake?
First, debug your router
$ php app/console router:debug --env=[env]
And use the correct environment
If the route shows up, then you probably need to clear the cache
$ php app/console cache:clear --env=[env]
If the route doesn't show up, then whatever bundle that provides that route isn't being loaded correctly.
Also, if you're using a front-controller with debugging turned on, you can check the web debug toolbar.
The message tells it all. Route with name fos_user_profile does not exist.
I guess this route name comes from FOSUserBundle, so check that VputiUserBundle extends it properly.
The path('fos_user_profile') does not exist. It routes to #FOSUserBundle/Resources/config/routing/profile.xml. There you can find the actual usable routes, like:
Edit profile

Detect routes and entities from Symfony2 vendor

i'm creating a bundle that adds an entity and a few routes to be use in a Symfony2 application.
I want my bundle to be used as a vendor, so I've created all the files, published it on GitHub and packagist and everything works fine.
My problem is now when I require the bundle in another project, my entities and my routes are not detected:
1) php app/console doctrine:schema:update doesn't detect any modification
2) When I try to hit a GET route from the vendor, here is the error I get:
No route found for "GET ..."
Any idea is welcome, what's the process to really do these things in a bundle?
Cheers.
Cyril
Take a look at the installation steps of the FOSUserBundle for example. Everyone who uses your published bundle, have to activate it in the appkernel and import the routes. For the entity I think the bundle user have also to subclass the entity.

Resources