When binding a sfForm to a request parameter I find myself often searching for the nameformat of the form. Usually I end up with something like the code below when I don't know the nameformat by heart:
$form = new CreateForm();
$form->bind($request->getParameter(str_replace('[%s]','',$form->getWidgetSchema()->getNameFormat())));
A convenience method would make it much nicer, and you don't have to look up the naming in your formclass files:
class sfForm
{
...
public function getName()
{
return str_replace('[%s]','',$this->widgetSchema->getNameFormat());
}
...
}
The initial example would then be:
$form = new CreateForm();
$form->bind($request->getParameter($form->getName()));