php - Unable to replace alias "templating" with "fos_rest.templating" -


i'm trying setup symfony3 microkelner work fosrestbundle , i've faced issues it.

i want use input json or xml , output json or xml.

i've did setup , face errors:

invalidargumentexception in containerbuilder.php line 766: service definition "templating" not exist.

and

invalidargumentexception in replacealiasbyactualdefinitionpass.php line 48: unable replace alias "templating" "fos_rest.templating".

this how config.yml looks (parts templating , fos_rest)

# friends of symfony rest fos_rest:   disable_csrf_role: role_api   view_response_listener: force   force_redirects:     html: true       param_fetcher_listener: true       body_listener:         decoders:           xml: fos_rest.decoder.xml           json: fos_rest.decoder.json       format_listener:         enabled: true         rules:           - { path: '^/', priorities: ['json', 'xml'], fallback_format: 'json', prefer_extension: false }       view:         formats:           xml: true           json: true         default_engine: json         failed_validation: http_bad_request 

also

templating:     engines: ['twig'] .... # twig configuration twig:     debug:            "%kernel.debug%"     strict_variables: "%kernel.debug%"     exception_controller: 'fos\restbundle\controller\exceptioncontroller::showaction' 

in microkelner use folowing bundles:

  $bundles = array(         new symfony\bundle\frameworkbundle\frameworkbundle(),         new fos\restbundle\fosrestbundle(),         new jms\serializerbundle\jmsserializerbundle(),         new symfony\bundle\twigbundle\twigbundle(),     );      if (in_array($this->getenvironment(), array('dev', 'test'), true)) {         $bundles[] = new symfony\bundle\webprofilerbundle\webprofilerbundle();     } 

versions of compontents use:

  • fosrestbundle: "1.7.7"
  • symfony: "3.0.0"

the question how setup rid of error , make symfony3 microkelner work fosrestbundle?

thank you.

are sure configuration correct? when dump container with:

$ bin/console debug:container | grep fos 

i see among many other lines:

fos_rest.templating            alias "templating"    

so fos_rest.templating alias of templating , that's why can replace , therefore 2 errors.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -