We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

how can access to global variable in volt template

in my index.php i have:

define('SITE_DOMAIN', $_SERVER['HTTP_HOST']);

and i want to access on my volt template:

{{ SITE_DOMAIN }}

but in volt compile:

<?php echo $SITE_DOMAIN; ?>

and the error messsage:

    Notice: Undefined variable: SITE_DOMAIN in /var/www/feedback/app/frontend/views/common.volt.php on line 1

Any Help?



25.4k
Accepted
answer

i have the answers!..

{{ constant("DIRECTORY_SEPARATOR") }}