[TYPO3-mvc] FLUID :: how can you access properties of m:n related objects?

Roland most.wanted at gmx.at
Thu Nov 3 11:42:31 CET 2011


> You can also assign a variable in the controller. Not specifically need for
> a ViewHelper.

and the variable would hold the first "Zulassung", right? but where has 
the variable be defined?

now, there is this getter in my Produkt.php:

--- quote ---
**
  *
  *
  */

public function getFirstZulassung() {
	$object = $this->getZulassungen(); // Or whatever
	$object->rewind();
	if ($object->valid()) {
		return $object->current();
	}
}
--- /quote ---

this should get the first Zulassung object, right? how can i assign this 
to the view?

this is how my list action in the ProduktController.php looks like:

--- quote ---

	/**
	 * action list
	 *
	 * @return void
	 */
	public function listAction() {
		$produkts = $this->produktRepository->findAllOrdered(array('name' => 
Tx_Extbase_Persistence_QueryInterface::ORDER_ASCENDING));
		$firstZulassung = $this->getFirstZulassung();
		$this->view->assign('produkts', $produkts);
		$this->view->assign('firstZulassung', $firstZulassung);
	}

--- /quote ---

unfortunatelly as mentioned this does not work...


More information about the TYPO3-project-typo3v4mvc mailing list