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

Hi, how to output a defined vars in valt? 怎样在volt模板中显示常量

Hi, how to output a defined vars in valt? 怎样在volt模板中显示常量

I define a var in PHP, define('APP_PATH', '../application'),how to show APP_PATH in volt??? 我定义了一个常量APP_PATH,怎样在volt中显示APP_PATH???



3.5k
Accepted
answer
edited Nov '16

Use constant function:

{{ constant('APP_PATH') }}

https://docs.phalcon.io/pl/latest/reference/volt.html#functions

Thanks very much.