Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

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('APPPATH', '../application'),how to show APPPATH in volt??? 我定义了一个常量APPPATH,怎样在volt中显示APPPATH???



1.6k
Accepted
answer
edited Nov '16

Use constant function:

{{ constant('APP_PATH') }}

https://docs.phalconphp.com/pl/latest/reference/volt.html#functions

Thanks very much.