Marc
Marc

Reputation: 493

Cakephp none add action forms

I have an index action in one of my controllers.

In this index action i wish to create a "search" form that calls another action within my controller with a post request.

All the documentation i could find on form creation in cakephp is about creating new elements (i.e insert data into a database ) and not actually sending data to another action / function.

here is an example:

    <?php echo $this->Form->create('Product'); ?>
<fieldset>
    <legend><?php echo __('Søg Produkt'); ?></legend>
    <?php
    echo $this->Form->input('Search field');
    ?>
</fieldset>
<?php echo $this->Form->end(__('Søg')); ?>

How would i send the value of my search field to another action? (so it redirects to that action and sends data to it)

Upvotes: 0

Views: 56

Answers (1)

floriank
floriank

Reputation: 25698

Did you try to read the documentation?

$this->Form->create('Product', array('url' => array('action' => 'search');

Upvotes: 1

Related Questions