Sure, you can pass in false or null as the model:
http://book.cakephp.org/view/1384/Creating-Forms
You would still read the form data from $this->data in the controller,
e.g. $this->data['test'] for a field called test.

But nothing stops you from using a drop down box for price even if you
link the form to a particular model. For example you could write:

echo $form->create('Product');
echo $form->input('price', array ('type' => 'select', 'values' =>
array ('10-20€', '20-30€'));
echo $form->end('Search');

Then you'd read the selected value from $this->data['Product']
['price'], just like before.

On Oct 19, 4:13 pm, daydreamer <[email protected]> wrote:
> Hi,
>
> I want to create a form in my view, in order to select a product in my
> model.
> However, I don't want to link this form to my "product" model, because
> for example I want my users to select a price range from a dropdownbox
> (10 - 20 €, 20 - 30€...), and I can't link the dropdownbox to price,
> since price is just 1 number.
>
> So is there a way I can create a form which is not connected to a
> model, so that I can query the model myself in my controller the way I
> want to?
> And how can I read my form data?
>
> For example, if I have
>
> echo $this->Form->input('test');
>
> in my view, how do I access the value of this test?
>
> Thanks a lot for your help !!

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 [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to