Code39 isn't the only barcode i need. if i can load new helpers from inside the method i'll load just the necessary ones.
On 3 Apr, 16:23, brian <[email protected]> wrote: > Why are you adding this Code39 to your $helpers array inside the > method? When your controller loads BarcodeHelper, it won't be properly > registered. > > > > On Fri, Apr 3, 2009 at 8:23 AM, Ernesto <[email protected]> wrote: > > > Hello. > > > i'm having some trouble with custom helpers. > > > This code (same as Bakery) works: > > > <?php > > class BarcodeHelper extends AppHelper { > > > var $helpers = array('Code39'); > > > function Code39($string) { > > > print_r($this->helpers); > > $codedData = $this->Code39->encode($string); > > > } > > > } > > ?> > > > this doesn't > > > <?php > > class BarcodeHelper extends AppHelper { > > > function Code39($string) { > > > print_r($this->helpers); > > $this->helpers[] = 'Code39'; > > $codedData = $this->Code39->encode($string); > > > } > > > } > > ?> > > > the PHP error output is "Undefined property: BarcodeHelper::$Code39" > > > in both cases the "print_r($this->helpers)" command outputs the same > > thing: > > > Array( [0] = "Code39" ) > > > Why the second option isn't working? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
