Problems with the routing file

0

Hello everyone I'm new using symfony, so I appeal to you for your humble help it happens that I found an exception:

  

The routing file   "/home/development/my_project_name/src/ApplicationBundle/Resources/config/routing.yml"   contains unsupported keys for "aplicacion_homepage":   "first_ application". Expected one of: "resource", "type", "prefix",   "path", "host", "schemes", "methods", "defaults", "requirements",   "options", "condition" in   /home/development/my_project_name/src/ApplicationBundle/Resources/config/routing.yml   (which is being imported from   "/home/development/my_project_name/app/config/routing.yml").

This is my route:

aplicacion_homepage:
    path:     /index
    defaults: { _controller: AplicacionBundle:Default:index }


    aplicacion_primera:
    path:     /primera/{usuario}
    defaults: { _controller: AplicacionBundle:Default:primera}

This my driver:

<?php

namespace AplicacionBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class DefaultController extends Controller
{
    public function indexAction()
    {
        return $this->render('AplicacionBundle:Default:index.html.twig');
    }


      public function primeraAction($usuario)
    {
        return $this->render('AplicacionBundle:Default:primera.html.twig',
 array('usuario'=>$usuario) );
    }
}
    
asked by dayana v 07.11.2017 в 19:43
source

1 answer

1

Applies a correct indent to your YML file:

aplicacion_homepage:
  path:     /index
  defaults: { _controller: AplicacionBundle:Default:index }


aplicacion_primera:
  path:     /primera/{usuario}
  defaults: { _controller: AplicacionBundle:Default:primera}

Notice that application_homepage and application_primera are at the same height. For more information, look for documentation on the YML format.

    
answered by 13.11.2017 в 15:55