It sounds like you want to pre-set the content of the field? That
would be the 'value' property.

$form->input->('myfiled', array('value' => 'This will show as the
fields starting content'));

Regards,
Don

On May 12, 6:31 am, Alonso <[email protected]> wrote:
> you're right,there is an array of users ($users), but I'm afraid I
> haven't explained myself well, what I'd like to know is if it's
> possible to display a constant string using input()? because every-
> time I try to do this, the string is displayed, but as a label.
>
> P.S. I did try what you told me about  placing array('type' => 'text')
> as the
> second argument of the input method, but it only forces the control to
> be a input text
>
> On 11 mayo, 20:38, Miles J <[email protected]> wrote:
>
>
>
>
>
>
>
> > Theres some magic that happens. If you have an ID field (user_id), it
> > will usually be a select. If you set a variable called $users to the
> > view, that input field will populate with that data.
>
> > You can overwrite that by just placing array('type' => 'text') as the
> > second argument of the input method.
>
> > On May 11, 10:54 am, Alonso <[email protected]> wrote:
>
> > > Hi, folks.
> > > I'm starting with CakePHP and after reviewing this tutorial 
> > > (http://book.cakephp.org/view/1543/Simple-Acl-controlled-Application
> > > )  and also after having  used the "cake bake" command to generate my
> > > models,
> > > controllers and views , everything is fine, but when I visit the
> > > Post's add view (views \ posts
> > > \ add.php), I find that instead of showing a input text for the
> > > username, it shows a select with all the usernames.
>
> > > this is the line in  the Post's add view that show the select.
>
> > >     echo $this->Form->input('user_id');
>
> > > Although I know how to display only the username of the currently
> > > logged-in user,  I don't know how to control the content to show in
> > > $this->Form->input()  because if I use a variable that is not part of
> > > the "Post" model , it's shown , but as the label for the input.
>
> > > Have you any idea how to solve this??

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to