I have 50 controllers, and 90 Models. Everywhere i was using/repeating same words 'login' and 'success'. I want to make one global constant so that i can access from anywhere in my controllers and models. How or where do you declare this following 2 line.
Try to put this somewhere to have global access:
defined('MYFIXED_WORD_SUCCESS')
|| define('MYFIXED_WORD_SUCCESS', "success");
defined('MYFIXED_WORD_LOGIN')
|| define('MYFIXED_WORD_SUCCESS', "login");
Example of repeating:
if (count($result) > 0)
{
$return = array(
'flag' => 'login', // replace it with MYFIXED_WORD_
'result'=> 'success',// replace it with MYFIXED_WORD_
'extra' => array(group'=>$rec->group,));