7.3.1.3 $options[‘url’]
If the desired form action isn’t in the current controller, you can specify a URL for the form action using the ‘url’ key of the $options array. The supplied URL can be relative to your CakePHP application, or can point to an external domain.
<?php echo $form->create(null, array('url' => '/recipes/add')); ?>
// or
<?php echo $form->create(null, array('url' => array('controller' => 'recipes', 'action' => 'add'))); ?>
//Output:
<form method="post" action="/recipes/add">
<?php echo $form->create(null, array(
'url' => 'http://www.google.com/search',
'type' => 'get'
)); ?>
//Output:
<form method="get" action="http://www.google.com/search">
<?php echo $form->create(null, array('url' => '/recipes/add')); ?>// or<?php echo $form->create(null, array('url' => array('controller' => 'recipes', 'action' => 'add'))); ?>//Output:<form method="post" action="/recipes/add"><?php echo $form->create(null, array('url' => 'http://www.google.com/search','type' => 'get')); ?>//Output:<form method="get" action="http://www.google.com/search">
Also check HtmlHelper::url method for more examples of different types of urls.


























