Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9160963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:51:39+00:00 2026-06-17T13:51:39+00:00

I made a new Symfony2 bundle and deleted the Acme bundle. Then I created

  • 0

I made a new Symfony2 bundle and deleted the Acme bundle.

Then I created a new Controller (MainController.php):

<?php
namespace My\BlogBundle\Controller;

class MainController extends Controller
{
    /**
     * @Route("/", name="index")
     * @Template()
     */
    public function indexAction()
    {

        return array();
    }

And a simple view: (Main/index.html.twig) which only contains a hello. My routing.yml is empty. When I run the whole project I get:

No route found for "GET /"
404 Not Found - NotFoundHttpException
1 linked Exception: ResourceNotFoundException »

What is wrong here and how to solve it?

Here is my routing debug:

\Symfony>php app/console router:debug
[router] Current routes
Name                     Method Pattern
_wdt                     ANY    /_wdt/{token}
_profiler_search         ANY    /_profiler/search
_profiler_purge          ANY    /_profiler/purge
_profiler_info           ANY    /_profiler/info/{about}
_profiler_import         ANY    /_profiler/import
_profiler_export         ANY    /_profiler/export/{token}.txt
_profiler_phpinfo        ANY    /_profiler/phpinfo
_profiler_search_results ANY    /_profiler/{token}/search/results
_profiler                ANY    /_profiler/{token}
_profiler_redirect       ANY    /_profiler/
_configurator_home       ANY    /_configurator/
_configurator_step       ANY    /_configurator/step/{index}
_configurator_final      ANY    /_configurator/final

I also cleared the cache with no success.

Here is the routes.yml:

my_blog:
    resource: "@MyBlogBundle/Resources/config/routing.yml"
    prefix:   /

and the routing.yml in MyBlogBundle/Resources/config/routing.yml is empty.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T13:51:41+00:00Added an answer on June 17, 2026 at 1:51 pm

    The way your routes.yml is setup, you are requesting the routing.yml file from your bundle.

    If you want to use annotations to manage the routes in your bundle, you have to write the routes.yml the following way:

    my_blog:
        resource: "@MyBlogBundle/Controller/MainController.php"
        prefix:   /
        type:     annotation
    

    And your controller needs to include the Route class from the FrameworkExtraBundle:

    <?php
    namespace My\BlogBundle\Controller;
    
    use Symfony\Bundle\FrameworkBundle\Controller\Controller;
    use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
    use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
    
    class MainController extends Controller
    {
        /**
         * @Route("/", name="index")
         * @Template()
         */
        public function indexAction()
        {
            return array();
        }
    }
    

    This assumes you have installed the SensioFrameworkExtraBundle (http://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/index.html#installation).

    More information on the route annotation: http://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/routing.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i made a new bundle, made a new controller made few entities entity does
I made a new project in XCode (console application). Then I added a new
I made a new class in Netbeans, and it has a little wrench icon
I made new document type in umbraco.then made some node by this document type
I made a new class, and I'm getting a null reference exception, and I
I made a new class named PageRangeListWidgetItem which inherits from QListWidgetItem class PageRangeListWidgetItem :
I made a new repository, and ran git add -A . I then noticed
I'm learning C++ and I made a new program. I deleted some of my
I made a new action filter (attribute, similar to [Authorize]) which authorizes access to
I have made a new Excel 2010 Add-in project, with VS10. When I run

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.