[TYPO3-mvc] Fluid / Extbase - Object evaluation problem

David Schreiber flashmasterdash at gmail.com
Tue Dec 29 13:12:50 CET 2009


Hello everybody,

I have some problem with accessing one of my MVC objects inside my
Fluid Template.

My model 'Commodity' has an protected property 'seller' which is of
the type 'Member'. Inside my class definition it looks like this

/**
 * @var Tx_MmfRrmarket_Domain_Model_Member
 * @lazy
 */
protected $seller;

My Member Model is derived from the FrontendUser class supported with
Extbase (I use the fe_users table extended by two columns).

Since there is defined a 'name' property inside the FrontendUser Model
I'd like to access it out of my Fluid template. After I (successfully)
mapped my commodity object, this should look like this:

{commodity.seller.name}

This won't work. Fluid throws me following exception:

InvalidArgumentException
$object must be an object or an array, string given.

Instead, when I output the seller with:

{commodity.seller}

It prints '4' - the uid of the FE-User. This ID is stored in the
commodities table, as well as in the fe_users table.

Since I defined the seller property as Member-Model (like written
before) shouldn't Extbase and Fluid automatically reference the
Member-Object instead of just using it's uid?

Sorry, I'm getting confused. Have I forgotten something? Maybe I
misunderstand some of the main concepts of Extbase or Fluid?

Help would be appreciated!
Thanks,
David Schreiber


More information about the TYPO3-project-typo3v4mvc mailing list