Rohitashv Singhal
Rohitashv Singhal

Reputation: 4557

cannot import resource in symfony2

I am new to symfony2. I am designing a form.

My action for 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 submission the form it should go to sub action. when i am running this code I am getting 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?

Upvotes: 6

Views: 12770

Answers (1)

Vitalii Zurian
Vitalii Zurian

Reputation: 17976

Such error usually appears when you have error in your resource file. In your case - I guess, you missed the pattern for task_new route

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

task_new:
    defaults: { _controller:AcmeTaskBundle:Task:sub }

Upvotes: 9

Related Questions