Tuesday, January 4, 2011

Re: Using a helper in a view of the PagesController

no no...use in PageController variable

public $helpers = array('helpername', 'helpername2');
--
Lep pozdrav, Tilen Majerle



2011/1/4 Matthias <matthias.gruetzner@googlemail.com>
Hi,
I created a date-formatting helper for displaying german day names.
Now I want to use it in a view of the PagesController. I inserted the
following code in the ctp file:

$this->helpers[] = 'DateFormat';
$this->loadHelpers($this->helpers, 'DateFormat');

It works, but i wonder if
1) is this the usual/best way to do it?
2) if i omit one of the lines it doesn't work, but writing is twice
seems wrong to me

If it's correct, just say it is :)

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: