How do you not provide the column name (or alias)? On Thu, Sep 20, 2012 at 11:00 PM, Léo Willian Kölln <[email protected]> wrote: > Yes, the column name (label). > > And no, i don't need to provide it on the FormHelper (necessarily). > I will use the method schema, but to implement a separate centralized label > definition on the model (o thing that i think should already be on the > Framework (suggestion)). > > Thanks guys. > > Léo Willian Kölln > > > > On Thu, Sep 20, 2012 at 6:54 PM, lowpass <[email protected]> wrote: >> >> What do you mean by "manually"? The point of writing it like that is >> that it will display the new value if you change it in the DB. >> >> Or are you referring to the column name? But you need to provide that >> to FormHelper anyway. >> >> I don't understand what problem you're trying to fix but there is the >> Model::schema() method. Perhaps that will help with whatever you're >> trying to do. >> >> On Wed, Sep 19, 2012 at 3:59 PM, Léo Willian Kölln <[email protected]> >> wrote: >> > 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. >> > >> > >> >> -- >> 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. > >
-- 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.
