Hi all,
Is any body have an idea to automaticaly initialize an helper ?
I try to put this code in constructor
class MyHelper extends AppHelper
{
function __construct() {
$view =& ClassRegistry::getObject('view');
$filename = $view->viewPath. DS . $view->action . '.js';
}
}
That does'nt work ; view wasn't created when MyHelper is create.
For the moment I do that :
class MyHelper extends AppHelper
{
function init() {
$view =& ClassRegistry::getObject('view');
$filename = $view->viewPath. DS . $view->action . '.js';
}
}
But, I need to call the function init() in view class before, that I
would avoid.
Tx for you help
Frederic
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---