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

Mario Hinterreiter m.hinterreiter at gmail.com
Thu Mar 13 08:19:38 CET 2014


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! 

More information about the Neos mailing list