SensacionRC
SensacionRC

Reputation: 615

Symfony YAML file concatenating parameters

Is there a way to do this:

//parameters.yml
app.basepath: 'C:\extrafolder'
app.specificpath: app.basepath + '\specificpath'

I want to concatenate strings to the app.basepath variable instead of repeating the string in app.basepath in all specific paths.

I have googled this but I´m a bit confused with the results

Upvotes: 3

Views: 8666

Answers (2)

Mitesh Vasava
Mitesh Vasava

Reputation: 735

You can't concatenate using "+" in yaml/yml file. Instead you could use "%". You can do it like:

//parameters.yml
app.basepath: 'C:\extrafolder'
app.specificpath: '%app.basepath%\specificpath'

Upvotes: 1

Nikita Leshchev
Nikita Leshchev

Reputation: 1844

Try to do something like that:

//parameters.yml
app.basepath: 'C:\extrafolder'
app.specificpath: '%app.basepath%\specificpath'

Upvotes: 11

Related Questions