Yes, What i´m doing is this, but this is what i want to avoid. As you see, you need to "manually" write the label. What if it changes? If it was not a problem, FormHelper would not implement a solution for this (label).
In my helper implementation i´m already using the formHelper label method implementation (almost full copy and paste). What i´m arguing is that a method for retrieving the Label text should be in other place, and the formHelper::label() method should use it. Léo Willian Kölln On Wed, Sep 19, 2012 at 2:28 PM, Amit <[email protected]> wrote: > Not entirely sure what you're looking for here. Regarding a simple way to > to output data from the model, it seems simple enough to do: > > <p>Field: <?php echo $model['Model']['field']; ?></p> > > If you're looking for how FormHelper->label() formats the field name, you > could reimplement the label function - > http://api20.cakephp.org/view_source/form-helper#line-782 > > On Wednesday, September 19, 2012 11:06:35 AM UTC-5, Léo Willian Kölln > wrote: >> >> As i´m implementing a CRUD i was trying to make a Helper to make the >> rendering of a Details screen more easy. >> >> The question is, If there is a FormHelper that i can use to help me >> render labels and fields, why does not exists a Helper to output simple >> (direct) data from a Model? >> >> I ask this because as i was trying to implement a Helper like this, one >> of the things is to determine the Label (as in a form, but no <label> tag), >> and there is no isolated implementation to get this info, only on the >> FormHelper->label(). In my opinion the implementation to get the "text" of >> a label should go on other place (maybe on the Helper base class?) as this >> is a separated concept. >> >> I´m wrong? There is other way to get this data? >> >> Léo Willian Kölln >> > -- > Like Us on FacekBook https://www.facebook.com/CakePHP > Find us on Twitter http://twitter.com/CakePHP > > --- > 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]. > Visit this group at http://groups.google.com/group/cake-php?hl=en. > > > -- Like Us on FacekBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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]. Visit this group at http://groups.google.com/group/cake-php?hl=en.
