Proposal to Combine Constants |
PHP now allows array Constants which could group current defines:
Code: // Works as of PHP 7
Sorry, what do you propose?
I think he means to use the new array constants for the defines in CodeIgniter 4
Also maybe the app/Config/Constants.php defines. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
That would work if data are meant to be arrays. However, if several items are grouped as arrays for the sake of utilizing array constants, I don't think it is worth the effort.
Imagine combining all the error code constants (EXIT_ERROR, EXIT_AUTO_MIN, EXIT_AUTO_MAX, etc.) to an array constant EXIT_CODES. So which one would you prefer to use the error exit code, EXIT_ERROR or EXIT_CODES[0] ?
I have four sites sites (soon to be more) all calling a common CI4 application and find the following ideal for displaying the relevant constants for each domain:
file: /app/Views/incs/QQQ.php Code: I thought the grouping may be useful instead of separate Constants? |
Welcome Guest, Not a member yet? Register Sign In |