Service parameter order

This is for discussion, mainly on 1.x but there's some 2.x topics here too.

Moderators: dwhittle, Ian

Service parameter order

Postby beyondwords » Fri Jul 29, 2011 3:52 pm

I'm trying to configure a service parameter for IdeatoSimplePagerBundle <https://github.com/ideatosrl/SimplePagerBundle> and I don't know where to put it so it will be recognised (it seems the configuration is just ignored).

In @IdeatoSimplePagerBundle/Resources/config/services.xml
Code: Select all
    <parameters>
        ...
        <parameter key="ideato.pager.max_per_page">4</parameter>
    </parameters>


In @MyBundle/Resources/config/services.yml
Code: Select all
parameters:
    ideato:
        pager.max_per_page: 20



The Ideato bundle doesn't have an Dependency Injection Extension so I included it as a resource at the top of my app/config/config.yml
Code: Select all
imports:
    - { resource: parameters.ini }
    - { resource: security.yml }
    pager_bundle:
        resource: @IdeatoSimplePagerBundle/Resources/config/services.xml


I'm assuming it's something about the order in which the service is loaded and the parameter is defined, but I've tried a number of variations without success.

The best I've managed for now is modifying the services.xml in the vendor bundle itself, but that's not ideal.

Thanks in advance!
beyondwords
Junior Member
 
Posts: 2
Joined: Fri Jul 29, 2011 3:33 pm

Re: Service parameter order

Postby beyondwords » Sat Jul 30, 2011 12:36 am

I misunderstood how Yaml handles parameters.

I thought:
Code: Select all
parameters:
    ideato:
        pager.max_per_page: 20


was equivalent to:
Code: Select all
parameters:
    ideato.pager.max_per_page: 20


It seems I got confused with another configuration language where nested elements are equivalent to dot-separated paths. :|

Apologies.
beyondwords
Junior Member
 
Posts: 2
Joined: Fri Jul 29, 2011 3:33 pm


Return to General discussion

Who is online

Users browsing this forum: No registered users and 1 guest