[TYPO3-mvc] How can I fill fields for related object
Gianluca Strafella
gianluca.strafella at webformat.com
Fri Jul 4 14:10:22 CEST 2014
Hi Dmitry,
in the controller action you can write:
//[...]
$newOrder =
$this->objectManager->create('TYPO3\\Catalog\\Domain\Model\\Order');
$newOrder->setStreet("a street");
$newOrder->setZip("a zip");
//[...]
$this->view->assign("newOrder",$newOrder);
and after, retrive order properties in the fluid template "New.html":
<f:form action="name_of_action_that_add_new_order_into_repository"
name="newOrder" object="{newOrder}">
<f:form.textfield property="street" />
<f:form.textfield property="zip" />
<f:form.submit value="Create new" />
</f:form>
Regards,
Gianluca Strafella
Software Developer
gianluca.strafella at webformat.com
WEBFORMAT srl – www.webformat.com
Il 02/07/2014 14:45, Dmitry Vasiliev ha scritto:
> Hi!
>
> I have model "Company -> n:1 Order"
>
> When I create new company, I write in controller
> $newOrder =
> $this->objectManager->create('TYPO3\\Catalog\\Domain\Model\\Order');
> And order is created
>
> In fluid how can I fill some fields for order, for new action. If I do
> like this, fields are empty
>
> <f:form.textfield property="order.company" />
> <f:form.textfield property="order.street" />
> <f:form.textfield property="order.zip" />
>
More information about the TYPO3-project-typo3v4mvc
mailing list