0
votes

I just installed Symfony 2.8 micro-framework using this tutorial:

https://knpuniversity.com/screencast/micro-symfony/bootstrap#play

but in the end after configuring config.yml

framework:

secret: ABC123

router:

resource: %kernel.root_dir%/config/routing.yml

templating:

engines: [twig]

i got the Symfony error

InvalidArgumentException in YamlFileLoader.php line 390: There is no extension able to load the configuration for "router" (in C:\xampp\htdocs\smmicro1/config/config.yml). Looked for namespace "router", found "framework", "twig", "sensio_framework_extra"

if i delete these router part lines:

router:

resource: %kernel.root_dir%/config/routing.yml

templating:

engines: [twig]

Symfony starts fine, but with the message:

Unable to find the controller for path "/". The route is wrongly configured.

How to configure everything to work properly ?

Thank you!

2

2 Answers

1
votes

I can only assume your yaml file looks like...

framework:
    secret: ABC123

router:
    resource: %kernel.root_dir%/config/routing.yml

templating:
    engines: [twig]

Whereas, the router and templating arrays should be children of the framework config like..

framework:
    secret: ABC123
    router:
        resource: %kernel.root_dir%/config/routing.yml
    templating:
        engines: [twig]
1
votes

set your config.yml file to exactly as this

    framework:
        secret:          "%secret%"
        router:
            resource: "%kernel.root_dir%/config/routing.yml"
        templating:
            engines: ['twig']

then in your parameters.yml set your secret to ABC123

parameters:
      database_host: yourdatabasehost
      database_port: yourdatabaseport
      database_name: yourdatabasename
      ...
      secret: ABC123

NOTE: ONLY CHANGE THE SECRET TO YOUR DESIRED VALUE