Constants can be created and accessed in a controller with
const YEAR = '2018';
then accessed with
self::YEAR
In a Yii app, place constants in config/main.php
'params'=>array(
// this is used in contact page
'year_senate'=>'2018',
),
then access it with
Yii::app()->params['year_senate']
252 - Reflection
9 years ago
No comments:
Post a Comment