PDA

View Full Version : do not display html tag in a xtemplate



fongus
17 Aug 2009, 3:20 AM
hello everyone,

I've got a problem to display correctly a result with html tag from my data base to my template.
an example :


<p>test appro sp&eacute;cifique</p>

in that case the html tag appear as text in my template.

my first ask is which function from ext or php i have to use to insert my data in the database :-/
and which one I have to use to display it in my browser correctly.:-/

actually my template result display my html tag instead of interpret it.

fongus
18 Aug 2009, 12:50 AM
anybody have an idea ?

Animal
18 Aug 2009, 2:36 AM
<p>test appro sp&amp;eacute;cifique</p>

fongus
18 Aug 2009, 3:12 AM
hello animal,
thanks for your helping

i will try to explain better :)

i had in my database this data.


<p>test appro sp&amp;eacute;cifique</p>this data are send in json from an ajax request.
i get response like that.


res = new Ext.util.JSON.decode(result.responseText);
then i apply my result to my template like that.


tplProjectView.overwrite(projetView.body,res);
the tpl render this result.


<p>test appro sp&amp;eacute;cifique</p> instead of




test appro spécifique

how i can display like the last one ?

Condor
18 Aug 2009, 3:20 AM
So your database contains double HTML encoded entries? Isn't your database wrong?

In your tplProjectView use:

{myfield:htmlDecode}

fongus
18 Aug 2009, 3:44 AM
ok it's works

and for that two ask ?


my first ask is which function from ext or php i have to use to insert my data in the database :-/
and which one I have to use to display it in my browser correctly.:-/
thks for your help

Condor
18 Aug 2009, 4:06 AM
You'll have to rephrase your question, because I don't understand what you are asking...