symfony - Using PHP global variable inside yml file -
i'm trying use $_server
global variable inside yml file cant find anywhere how php. online examples doing ruby. possible php?
you can server variables same way $_get
, $_post
.
$request->server->get('your_variable') // specific $_server variable $request->server->all() // $_server variables
update:
to them in config files following (taken openshift symfony2 distribution - https://github.com/hasinhayder/openshift-symfony-2.3.0/tree/master/php/app/config)
set parameters in php file, in example above it's called params.php
<?php $container->setparameter('parameter_one', $_server['parameter_one']);
then include in config.yml file
imports: - { resource: parameters.yml } - { resource: security.yml } - { resource: params.php }
and should able use them if had been set in regular linked yml file like
%parameter_one%
Comments
Post a Comment