Hi guys,
Is any body has an idea to automatically 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 doesn't work because view wasn't created when MyHelper is
created.
The 'ugly' solution I do is:
class MyHelper extends AppHelper
{
function init() {
$view =& ClassRegistry::getObject('view');
$filename = $view->viewPath. DS . $view->action . '.js';
}
}
But, that need a call to function init() in view class before, that I
would avoid.
Thanks you 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
-~----------~----~----~----~------~----~------~--~---