Istiak Mahmood
Istiak Mahmood

Reputation: 2422

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.

Upvotes: 2

Views: 603

Answers (1)

Max Lipsky
Max Lipsky

Reputation: 1852

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

Upvotes: 2

Related Questions