I am creating a very basic static page in symfony2 but I am getting no route found error and i already defined the route for my page.
My controller
#src/IDP/IDPBundle/Controller/PortfolioController.php
<?php
namespace IDP\IDPBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class PortfolioController extends Controller
{
public function indexAction()
{
return $this->render('IDPIDPBundle:Portfolio:index.twig');
}
}
My routing.yml file
#src/IDP/IDPBundle/resources/config/routing.yml
IDPIDPBundle_portfolio:
pattern: /portfolio
defaults: { _controller: IDPIDPBundle:Portfolio:index }
requirements:
_method: GET
My routing file in app
#app/config/routing.yml
IDPIDPBundle:
resource: "@IDPIDPBundle/Resources/config/routing.yml"
prefix: /
# Internal routing configuration to handle ESI
#_internal:
# resource: "@FrameworkBundle/Resources/config/routing/internal.xml"
# prefix: /_internal
and when I try this url in the browser the symfony welcome page comes
http://project.dev/app_dev.php/
but when I try
http://project.dev/app_dev.php/portfolio
it give no route found error
What I m doing wrong here ?
any ideas please ?
Make sure that the changes you made is affected in the root of you project not only in the work space of eclipse. Change your eclipse work space to your project root and then
Hope it will help