J
J
jehord2015-03-15 17:45:46
Yii
jehord, 2015-03-15 17:45:46

How to install counters "Yandex metrics, etc." only on YII_ENV_PROD using twig template engine?

As far as I know, it is necessary to manipulate the YII_ENV_PROD variables for working on prod and YII_ENV_DEV for local development
. Apparently, it is necessary to use the YII_ENV_PROD variable in the twig template
{% if (YII_ENV_PROD) %}
// counter codes here
{% endif %}
But this design does not work , please tell me what is needed in order to be able to do checks with these constants.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander N++, 2015-03-16
@sanchezzzhak

Have you looked at twig.sensiolabs.org/doc/functions/constant.html
?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question