the HTML helper so that it can render the HTML instead of you
concatenating.
class MyHelper {
public $helpers = array('Html');
public function introMessage($msg) {
return $this->Html->div('intro', $msg);
}
}
Instead of:
class MyHelper {
public function introMessage($msg) {
return '<div class="intro">'. $msg .'</div>';
}
}
On Sep 22, 12:58 pm, "Evan R. Murphy" <evanrmur...@gmail.com> wrote:
> On Sep 22, 2:40 am, AD7six <andydawso...@gmail.com> wrote:
>
> > Was this an academic exercise in how to make the least legible code [...] ?
> > You have 0 hope, assuming you got it to work, of anyone except
> > yourself understanding what your example does.
>
> Accumulator variables are a common idiom in programming. (Seehttp://progzoo.net/wiki/PHP:Accumulate_with_Various_Operationsfor
> some examples.) People who know the idiom probably wouldn't find that
> code so convoluted.
>
> > PS the tag function's primary use is within other helper functions -
> > not necessarily in your own view files.
>
> Could you elaborate on this?
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:
Post a Comment