Thank you, AD that works perfectly.

On 12 jan, 16:07, AD7six <[EMAIL PROTECTED]> wrote:
> On Jan 12, 3:34 pm, "[EMAIL PROTECTED]"
>
>
>
> <[EMAIL PROTECTED]> wrote:
> > 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.
>
> If you rename init beforeRender() it'll at least get called.
>
> hth,
>
> AD
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to