[FLOW3-general] Access fluid form object
"Christian Müller (Kitsunet)"
christian.mueller at typo3.org
Wed Jan 11 13:54:26 CET 2012
Right, and for this action (which is called in the error case too) you
should expect the $newItem argument too:
public function newAction(\Totem\Lewin\Domain\Model\Item $newItem = NULL) {
(and don't forget to update the annotation)
And if you move the validation to the model you should also annotate
IgnoreValidation to the method. Finally assign the newItem to your
template. It will either be NULL (if first call to the action) or filled
with a non validated, possibly incomplete model object, but you can
reuse the entered values that way.
Cheers,
Christian
On 11/01/12 11:34, Thomas Plessis wrote:
> For validator, yes you're right, i can move them to model. And yes, i've another action to display the form :
>
> /**
> * Show a form for creating a new item object
> *
> * @return void
> */
> public function newAction() {
> // Orders all regions by label ASC and assign them to the view
> $this->regionRepository->setDefaultOrderings(array('label' => \TYPO3\FLOW3\Persistence\QueryInterface::ORDER_ASCENDING));
> $this->view->assign('regions', $this->regionRepository->findAll());
> $this->view->assign('itemCategories', $this->categoryRepository->findCategoriesAsSelect());
> }
>
More information about the FLOW3-general
mailing list