it's simple:

get the unescaped object/variable first... and call your function...

ver a.: $sf_user->getRawValue()->getTopics();

ver b.: sfOutputEscaper::unescape($sf_user)->getTopics();

be careful: the symfony doesn't escape nulls and integers... so the
getRawValue cause undefined function exception...

I personally  prefer the first way..

On Jan 21, 2:28 pm, HAUSa <[email protected]>
wrote:
> If I try to access a function in my User class (myUser.class.php), the
> results is being escaped in a template.
>
> This makes the code below a mess:
> <?php if(!in_array($topic->getId(), $sf_user->getTopics())): ?>
>
> I receive this error message:
> Warning: in_array() expects parameter 2 to be array, object given in /
> home/httpd/vhosts/krantcafe.nl/httpdocs/apps/community/modules/topic/
> templates/_record.php on line 5
>
> That is because my Array is an instance of
> sfOutputEscaperArrayDecorator now.
>
> How can I get the original array, that the $sf_user->getTopics()
> returns?

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to