Whenever you see something surrounded by two percent signs in a config file,
it’s a parameter. Parameters are like variables: you set them somewhere and
then use them with this syntax. So where are these being set?
Open up parameters.yml to find the answer:
# app/config/parameters.yml# ...# This file is auto-generated during the composer installdatabase_driver:pdo_mysqldatabase_host:127.0.0.1database_port:nulldatabase_name:knp_eventsdatabase_user:rootdatabase_password:null# ...
In episode 1, we talked about how this file is special because it holds
any server-specific configuration. This works because it’s in our .gitignore
file so that every developer and server can have their own. So we set parameters
here and use them anywhere else.
But technically, we can add parameters to any configuration file. Go back
to config.yml and add a new parameters key anywhere in the file. Below
it, create a new parameter called our_assets_version, and set it to the
assets_version value we’re using below: