What you are doing is perfectly fine, I personally use $this->helpers
[] = 'Blah'; since it's quick and easy.

Cake will only load your helper once even if it appears multiple times
in your helpers array, so don't even worry about checking for this.

Heck, just include it twice to make sure it gets loaded!

$this->helpers[] = 'Textile';
$this->helpers[] = 'Textile';
$this->helpers[] = 'Javascript';
$this->helpers[] = 'Javascript';

(j/k on that last bit by the way)

On Dec 16, 11:31 pm, Rob Wilkerson <[email protected]> wrote:
> How should I add multiple action-specific helpers?  Originally I had:
>
> $this->helpers[] = 'Textile';
>
> When I wanted to include the Javascript helper for this action, I
> couldn't find the "right" syntax (if there is a right syntax) to do
> so. I want to retain the default helpers, too.  I've made it work
> using traditional PHP array syntax, but am wondering if that's going
> to cause me any problems down the line.  For now, at least, I have:
>
> array_push ( $this->helpers, 'Textile' );
> array_push ( $this->helpers, 'Javascript' );
>
> Total noob question, I know, but I _am_ a noob so it probably won't be
> the last time while I get a grip on what's possible and the best
> practices. :-)
>
> Thanks.
>
> Rob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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