[FLOW3-general] f:form.errors ViewHelper
Heiko Kromm | Paints
h.kromm at paints.de
Fri Apr 29 10:48:55 CEST 2011
Hi list,
is there any trick to use the form.errors ViewHelper?
I have a domain model Job with a property tite
/**
* Job Title
* @validate StringLength(minimum = 1)
* @var string
*/
protected $title;
My JobController and new/createActions look like this:
/**
* New edit form
*
*
* @param \F3\Test\Domain\Model\Job\Job $newJob a new Job to work on
* @dontvalidate $newJob
* @return void
*/
public function newAction(\F3\Test\Domain\Model\Job\Job $newJob = NULL) {
$this->view->assign('newJob', $newJob);
}
/**
* Creates a new job
*
* @param \F3\Test\Domain\Model\Job\Job $newJob A new Job object
* @return void
*/
public function createAction(\F3\Test\Domain\Model\Job\Job $newJob) {
$this->jobRepository->add($newJob);
$this->flashMessageContainer->add('Job created.');
$this->redirect('index');
}
When I create a new Job, without a title, I will get a message for the the flashMessages, telling me that validation failed. But there is no output in the f:form.errors ViewHelper.
I inserted a var_dump in the ErrorsViewHelper.php and it tells me that there are Validation errors, but the errors array is empty.
array(1)
' newJob ' (6) => F3\FLOW3\MVC\Controller\ArgumentError prototype
message => ' Validation errors for argument "newJob" ' (39)
code => integer 1245107351
propertyName => ' newJob ' (6)
errors => array(empty) I hope there is a way to get the validation output working.
Heiko
More information about the FLOW3-general
mailing list