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

Roland most.wanted at gmx.at
Thu Nov 3 12:20:44 CET 2011


IT WORKS!

to sum it up: define the getter-method in the controller. period.


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

public function getFirstZulassung() {
	$object = $this->getZulassungen(); // Or whatever
	// Maybe you can drop the instanceof validation
	//if ($object instanceof Tx_Extbase_Persistence_ObjectStorage) {
		$object->rewind();
		if ($object->valid()) {
			return $object->current();
		}
	//}
}
--- /quote ---

...and then you can output e.g. the UID of the first Zulassung via:

{produkt.firstZulassung.uid}

i guess this is what you call convention over configuration, right?

thanks so much!


More information about the TYPO3-project-typo3v4mvc mailing list