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

Sebastian Schreiber me at schreibersebastian.de
Thu Nov 3 12:26:16 CET 2011


Am 03.11.2011 12:20, schrieb Roland:
> 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!
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
you are welcome.

-- 
Sebastian Schreiber
(Medieninformatiker B.Sc.)
(TYPO3 Certified Integrator)

Schanzenstraße 27, Schlosserei 4
D-51063 Köln

T  0221 677 88 541
M  0176 431 05 790

Skype schreibersebastian.de

me at schreibersebastian.de
www.schreibersebastian.de

Steuernummer: 217 / 5269 / 4675



More information about the TYPO3-project-typo3v4mvc mailing list