[Neos] How to read values from a model-object in PHP (Controller)

Axel Wüstemann awu at qbus.de
Thu Mar 13 07:29:29 CET 2014


You should have a basketRepository

$baskets = $this->basketRepository->findAll();
foreach ($baskets as $basket) {
	$value = $basket->getValue();
}

see:
http://docs.typo3.org/flow/TYPO3FlowDocumentation/stable/TheDefinitiveGuide/PartII/ModelAndRepository.html

Am 13.03.2014 08:19, schrieb Mario Hinterreiter:
> Hi,
>
> In an own neos-extension, in my controller I have an object fetched from
> my model from which I want to read it's values.
> To be concrete, I'm building a little basket and fetch the items from
> it. now just I want to know the price of each item.
>
> // I fetch the items like this:
> $items = $this->basketModel->getItems();
>
> // ... and walk through the array:
> foreach ($items as $item ) { ... }
>
> In the fluid-template I can read the price value simple with
> {item.price} after assigning it like this:
> $this->view->assign('item', $item['offer']);
>
> But how can I read out the price-value directly with PHP code in my
> controller?
> Would be happy about every hint!
> _______________________________________________
> Neos mailing list
> Neos at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/neos


-- 
Qbus Werbeagentur GmbH

18055 Rostock, Heiligengeisthof 5
Tel:   0381 4 61 39 - 10 | Fax: - 22
21029 Hamburg, Chrysanderstraße 69A
Tel:   040 60 94 59 75
Mobil: 0179 46 455 46

www.xing.com/profile/Axel_Wuestemann
www.issuu.com/QbusAgentur/docs/qbus-referenzen?mode=embed

Handelsregister: HRB 11218 beim Amtsgericht Rostock Sitz der
Gesellschaft: Hansestadt Rostock
Geschäftsführer: Dipl.-Ing. Axel Wüstemann

www.qbus.de | www.qbus.de/qblog
www.facebook.com/QbusAgentur


More information about the Neos mailing list