How can i declare a global array in constants.php?
I want use an array of this form in a helper file.
$process['up_position']['Title']='Up position';
$process['up_position']['icon']='icon-up';
$process['up_position']['description']='Up a position';
$process['down_position']['Title']='Down position';
$process['down_position']['icon']='icon-down';
$process['down_position']['description']='Down a position';
What is the better way?
Thank you!!
I see constants.php but all constants are simple values
Constants are simple values in general. These are values that never change. My own opinion is
It all depends where you read / use them from. I see you have "title", "icon" and "description" so these seem to be objects used in a view, I'd assume. Then you can create a controller super class where objects like that are created, you just assign the values to them once you call the view and the view will have the values.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.