find('list') that displays blank (combobox)
The group you are posting to is a
Usenet group . Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
From:
mario <marioqta... @gmail.com>
Date: Sat, 27 Sep 2008 20:48:05 -0700 (PDT)
Local: Sat, Sep 27 2008 11:48 pm
Subject: find('list') that displays blank (combobox)
Hello everyone,
I'm creating a search page in my website and I want to take advantage
of cakephp's find('list') command.
Here is a snippet of my controller's code,
$collections = $this->Exhibit->Collection->find('list',
array(
'order' => 'Collection.name ASC',
'fields' => array('Collection.id', 'Collection.name')
));
$this->set(compact('collections'));
Now in here, I want to generate a list of collections with their
corresponding id and name.
For my view,
I have this one:
<?php echo $form->input('collection_id', array('label'=> false)); ?>
As you can see, it will try to create a combobox based from my
collections list. My problem is that since i'm doing a search here, I
want to have a blank field display at the top most of my combobox
which find('list') can't seem to handle.
Please help.
Thanks,
Mario
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Adam Royle <a... @sleekgeek.com.au>
Date: Sat, 27 Sep 2008 20:54:32 -0700 (PDT)
Local: Sat, Sep 27 2008 11:54 pm
Subject: Re: find('list') that displays blank (combobox)
<?php echo $form->input('collection_id', array('label'=> false,
'empty' => true)); ?>
or
<?php echo $form->input('collection_id', array('label'=> false,
'empty' => 'Please select...')); ?>
On Sep 28, 1:48 pm, mario <marioqta... @gmail.com> wrote:
> Hello everyone,
> I'm creating a search page in my website and I want to take advantage
> of cakephp's find('list') command.
> Here is a snippet of my controller's code,
> $collections = $this->Exhibit->Collection->find('list',
> array(
> 'order' => 'Collection.name ASC',
> 'fields' => array('Collection.id', 'Collection.name')
> ));
> $this->set(compact('collections'));
> Now in here, I want to generate a list of collections with their
> corresponding id and name.
> For my view,
> I have this one:
> <?php echo $form->input('collection_id', array('label'=> false)); ?>
> As you can see, it will try to create a combobox based from my
> collections list. My problem is that since i'm doing a search here, I
> want to have a blank field display at the top most of my combobox
> which find('list') can't seem to handle.
> Please help.
> Thanks,
> Mario
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
mario <marioqta... @gmail.com>
Date: Sat, 27 Sep 2008 23:24:41 -0700 (PDT)
Local: Sun, Sep 28 2008 2:24 am
Subject: Re: find('list') that displays blank (combobox)
Thanks a lot. I got it working now. =)
On Sep 27, 8:54 pm, Adam Royle <a... @sleekgeek.com.au> wrote:
> <?php echo $form->input('collection_id', array('label'=> false,
> 'empty' => true)); ?>
> or
> <?php echo $form->input('collection_id', array('label'=> false,
> 'empty' => 'Please select...')); ?>
> On Sep 28, 1:48 pm, mario <marioqta... @gmail.com> wrote:
> > Hello everyone,
> > I'm creating a search page in my website and I want to take advantage
> > of cakephp's find('list') command.
> > Here is a snippet of my controller's code,
> > $collections = $this->Exhibit->Collection->find('list',
> > array(
> > 'order' => 'Collection.name ASC',
> > 'fields' => array('Collection.id', 'Collection.name')
> > ));
> > $this->set(compact('collections'));
> > Now in here, I want to generate a list of collections with their
> > corresponding id and name.
> > For my view,
> > I have this one:
> > <?php echo $form->input('collection_id', array('label'=> false)); ?>
> > As you can see, it will try to create a combobox based from my
> > collections list. My problem is that since i'm doing a search here, I
> > want to have a blank field display at the top most of my combobox
> > which find('list') can't seem to handle.
> > Please help.
> > Thanks,
> > Mario
You must
Sign in before you can post messages.
You do not have the permission required to post.