I would use helpers rather than putting html in the model:
// in MyUserHelper.php:
function user_format(User $user)
{
return '<strong>'.$user->name.'</strong>';
}
// In your template:
echo user_format($user);
On Sun, May 2, 2010 at 5:10 AM, Daniel Lohse
<[email protected]> wrote:
> That is symfony's output escaping at work in the view layer. You'll need to
> read up on that here:
> http://www.symfony-project.org/book/1_2/07-Inside-the-View-Layer#chapter_07_output_escaping
>
> Cheers, Daniel
>
> On 02.05.2010, at 10:44, comb wrote:
>
>> Hey :-)
>>
>> How can I use some html in a __toString methode?
>> I want to link a user-profile in the Users-toString-Methode, but the
>> html is escaped :-/
>>
>> --
>> 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
>
> --
> 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
>
--
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