Thursday 17 February 2005 6:44:17 am
Olivier, The content() function of a contentobject attribute either returns a simple type (string, integer, boolean, float, array, ...) or an object of a "helper" class (e.g. ezuser). For simple types, you can use PHP's gettype() function. For objects, you can use PHP's get_class() function. Example:
$content = $dataMap[$attrib]->content();
$type = gettype( $content );
if( $type == 'object' )
{
$type = get_class( $content );
}
print( $type );
You can also trace it through the PHP code if you're familiar with (sometimes) complex PHP code. That's the way Tom and I learned it. Eivind, $current_user is not a node object. I assume your $current_user is the result of a fetch of the currently logged in user. In that case, the result of the fetch is exactly the same than that of the content() function of a ezuser datatype. Olivier's code:
print( get_class( $dataMap['user_account']->content ) );
and your code:
{get_class( $current_user )}
would both say the same thing: ezuser The .email in the templates then translates to the ->attribute( 'email' ) in PHP code. hth
Hans
http://blog.hansmelis.be
|