Posts Tagged ‘forms’
The new form system is very powerful and decoupled. It means that the form creation code and the validation code can be used independently.
Here is the default generated code for an update action :
public function executeUpdate($request)
{
…
$this->form = new ProductForm(productPeer::retrieveByPk($request->getParameter(‘id‘)));
$this->form->bind($request->getParameter(‘product‘));
if ($this->form->isValid())
{
…
}
}
The action automatically binds the product request parameter which correspond to a entire product form.
What if you want to make a simple [...]