7.3.1.3 $options[‘url’]
Wenn die gewünschte Zieladresse (action) nicht der aktuelle Controller ist, kann ein Ziel-Url über den URL Schlüssel des $option Array angegeben werden. Hier ist ein relativer Verweis innerhalb der CakePhp Installation, oder eine externe URL möglich.
<?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.


























