Cannot import resource in symfony2

Hi guys, I'm new to symfony2. I am developing a form: my action for the submission is task_new. and my routing.yml is as follows

task: pattern: /task/ defaults: { _controller: AcmeTaskBundle:Task:new} task_new: defaults:{_controller:AcmeTaskBundle:Task:sub} 

I want that after submitting the form, it should go to the sub-action. when I run this code, I get the following error:

Cannot import resource "C: \ wamp \ www \ Symfony \ src \ Acme \ TaskBundle / Resources / config / routing.yml" from "C: / wamp / www / Symfony / app / config \ routing.yml".

what should I do?

+6
source share
1 answer

This error usually appears if there is an error in your resource file. In your case - I think you missed the pattern route for task_new

Also check if defaults starts immediately after 4 spaces from the beginning

 task_new: defaults: { _controller:AcmeTaskBundle:Task:sub } 
+9
source

Source: https://habr.com/ru/post/921270/


All Articles