symfony accessing array parameters from parameters.yml in services.ymlHow to access nested parameter values in Symfony2?Symfony 2 error: …must be an instance of SymfonyComponentSecurityHttpHttpUtils in services.ymlHow to refer to parameters.yml in services.yml?Access Symfony Config Parameter in Entity Repository or AnywhereCan not authorize in Active Directory in Symfony 3symfony pdo_pgsql doctrine:database:create does not use parametersSymfony 2.8 injecting twigSymfony: Accessing parameters without container or static configured serviceSymfony2 Redis Validator, string instead of ClassMetadataSymfony 3.4 overwrites env variables with the ones from parameters.ymlCall Symfony Repository method with parameters from array

How to align and center standalone amsmath equations?

How to color a curve

MAXDOP Settings for SQL Server 2014

Did US corporations pay demonstrators in the German demonstrations against article 13?

How to decide convergence of Integrals

Could solar power be utilized and substitute coal in the 19th Century

Should I install hardwood flooring or cabinets first?

What major Native American tribes were around Santa Fe during the late 1850s?

How do you respond to a colleague from another team when they're wrongly expecting that you'll help them?

About a little hole in Z'ha'dum

Can we have a perfect cadence in a minor key?

Hot bath for aluminium engine block and heads

List of people who lose a child in תנ"ך

How do ground effect vehicles perform turns?

Folder comparison

Does the Mind Blank spell prevent the target from being frightened?

How much character growth crosses the line into breaking the character

Can someone explain how this makes sense electrically?

Have I saved too much for retirement so far?

Can the Supreme Court overturn an impeachment?

Find last 3 digits of this monster number

Is it improper etiquette to ask your opponent what his/her rating is before the game?

What does this horizontal bar at the first measure mean?

Should I stop contributing to retirement accounts?



symfony accessing array parameters from parameters.yml in services.yml


How to access nested parameter values in Symfony2?Symfony 2 error: …must be an instance of SymfonyComponentSecurityHttpHttpUtils in services.ymlHow to refer to parameters.yml in services.yml?Access Symfony Config Parameter in Entity Repository or AnywhereCan not authorize in Active Directory in Symfony 3symfony pdo_pgsql doctrine:database:create does not use parametersSymfony 2.8 injecting twigSymfony: Accessing parameters without container or static configured serviceSymfony2 Redis Validator, string instead of ClassMetadataSymfony 3.4 overwrites env variables with the ones from parameters.ymlCall Symfony Repository method with parameters from array













0















I got my parameters.yml which looks like the following:



parameters
ldap:
host: 192.168.0.1
port: 389


and my services.yml which looks like this:



ldap:
class: SymfonyComponentLdapLdap
factory: [ 'SymfonyComponentLdapLdap', 'create']
arguments:
- ext_ldap
- host: '%ldap%' # need to pass nested param here (from array)
- debug: true


Here in arguments section in host param previously I had a plain string passed from parameters.yml. Now host param in parameters.yml was moved 1 level lower and I need to get it from there and pass to services.yml. I tried something like this:



'%ldap%['host']'


or



'ldap.host'


or



'ldap['host']'


nut none of them worked. Is there some way to access array params passed from parameters.yml in services.yml.










share|improve this question
























  • issue solved with the help of THIS post

    – Jack
    Mar 7 at 15:15











  • Possible duplicate of How to access nested parameter values in Symfony2?

    – Anthon
    Mar 8 at 6:30















0















I got my parameters.yml which looks like the following:



parameters
ldap:
host: 192.168.0.1
port: 389


and my services.yml which looks like this:



ldap:
class: SymfonyComponentLdapLdap
factory: [ 'SymfonyComponentLdapLdap', 'create']
arguments:
- ext_ldap
- host: '%ldap%' # need to pass nested param here (from array)
- debug: true


Here in arguments section in host param previously I had a plain string passed from parameters.yml. Now host param in parameters.yml was moved 1 level lower and I need to get it from there and pass to services.yml. I tried something like this:



'%ldap%['host']'


or



'ldap.host'


or



'ldap['host']'


nut none of them worked. Is there some way to access array params passed from parameters.yml in services.yml.










share|improve this question
























  • issue solved with the help of THIS post

    – Jack
    Mar 7 at 15:15











  • Possible duplicate of How to access nested parameter values in Symfony2?

    – Anthon
    Mar 8 at 6:30













0












0








0








I got my parameters.yml which looks like the following:



parameters
ldap:
host: 192.168.0.1
port: 389


and my services.yml which looks like this:



ldap:
class: SymfonyComponentLdapLdap
factory: [ 'SymfonyComponentLdapLdap', 'create']
arguments:
- ext_ldap
- host: '%ldap%' # need to pass nested param here (from array)
- debug: true


Here in arguments section in host param previously I had a plain string passed from parameters.yml. Now host param in parameters.yml was moved 1 level lower and I need to get it from there and pass to services.yml. I tried something like this:



'%ldap%['host']'


or



'ldap.host'


or



'ldap['host']'


nut none of them worked. Is there some way to access array params passed from parameters.yml in services.yml.










share|improve this question
















I got my parameters.yml which looks like the following:



parameters
ldap:
host: 192.168.0.1
port: 389


and my services.yml which looks like this:



ldap:
class: SymfonyComponentLdapLdap
factory: [ 'SymfonyComponentLdapLdap', 'create']
arguments:
- ext_ldap
- host: '%ldap%' # need to pass nested param here (from array)
- debug: true


Here in arguments section in host param previously I had a plain string passed from parameters.yml. Now host param in parameters.yml was moved 1 level lower and I need to get it from there and pass to services.yml. I tried something like this:



'%ldap%['host']'


or



'ldap.host'


or



'ldap['host']'


nut none of them worked. Is there some way to access array params passed from parameters.yml in services.yml.







symfony






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 8 at 6:29









Anthon

31.4k1796150




31.4k1796150










asked Mar 7 at 14:58









JackJack

430319




430319












  • issue solved with the help of THIS post

    – Jack
    Mar 7 at 15:15











  • Possible duplicate of How to access nested parameter values in Symfony2?

    – Anthon
    Mar 8 at 6:30

















  • issue solved with the help of THIS post

    – Jack
    Mar 7 at 15:15











  • Possible duplicate of How to access nested parameter values in Symfony2?

    – Anthon
    Mar 8 at 6:30
















issue solved with the help of THIS post

– Jack
Mar 7 at 15:15





issue solved with the help of THIS post

– Jack
Mar 7 at 15:15













Possible duplicate of How to access nested parameter values in Symfony2?

– Anthon
Mar 8 at 6:30





Possible duplicate of How to access nested parameter values in Symfony2?

– Anthon
Mar 8 at 6:30












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55046801%2fsymfony-accessing-array-parameters-from-parameters-yml-in-services-yml%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55046801%2fsymfony-accessing-array-parameters-from-parameters-yml-in-services-yml%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown