Try encoding the link_to($duplicate->name, 'show_place', array('id' =>
$duplicate->id)),)); result with htmlentities before passing it to the
validator.
It's being escaped for safe display with the output escaper.

If that doesn't work  then you'll need to use a fragment or a component and
handle the rendering yourself.
I'm guessing your using echo $form - which in this scenario probably isn't
the best strategy - it would be better to handle the rendering yourself.

-----Original Message-----
From: [email protected] [mailto:[email protected]]
On Behalf Of elbouillon
Sent: 15 May 2009 20:14
To: symfony developers
Subject: [symfony-devs] sfValidator message and link


Hi all,

I've created added a personalised message to sfDoctrineUnique
validator, in this message there y a link, when the error is throw in
the brother the link is shown as if it was text.

Here is the php code :

$this->addMessage('duplicate', "There is an other %place_type% at this
address. It should be the same. Follow this %link% if you want to
check.");

$error = new sfValidatorError($this, 'duplicate', array(
                'place_type'   => $values[$this->getOption('type')],
                'link'      => link_to($duplicate->name, 'show_place',
array('id' => $duplicate->id)),
            ));

Here is what it's displayed :

[T]there is an other toilet at this address. It should be the same.
Follow this <a href="/frontend_dev.php/place/show/23">place[fr][name]</
a> if you want to check.[/T]

Any idea ?
Thanks

Mickael


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony developers" 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-devs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to