nath-0
(Nathalie Chabert)
November 19, 2012, 9:06am
1
Hello,
I have a field that is populate with a rich text editor.
So in the database I have for exemple:
how to interpreate html tag such <strong> ?
I would like to do this in a gridView and to remove <strong> but to have the text in bold.
Thanks
Nath
Keith
(Kburton)
November 19, 2012, 9:10am
2
If it’s just for that tag, you could probably get away with a basic regular expression. Why do you want to remove the tag if it’s already making the text bold?
nath-0
(Nathalie Chabert)
November 19, 2012, 9:37am
3
ho Ketih again you, thanhs !
No but the tag don’t make the text bold. I know my english is very bad so it is hard for me to excplain and for people to understand me
In fact I don’t what to remove the tag, but just to intepreate the tag. Because until now I can see the tag in my grid view and I would like not see them but see them in bold text
redguy
(Maciej Lizewski)
November 19, 2012, 10:34am
4
add ‘type’=>‘raw’
$this->widget( 'CGridView', array(
...
'columns'=>array(
array( 'name'=>'column', 'type'=>'raw' ),
...
),
));
1 Like
Keith
(Kburton)
November 19, 2012, 10:34am
5
In which case, you just need to set the type to ‘html’ in the column config. See here.
EDIT: Defeated by redguy’s ninja-fu yet again…
nath-0
(Nathalie Chabert)
November 19, 2012, 10:44am
6
I put :
‘type’ => ‘html’,
array(
'name' => 'nomMessageLangue',
'type' => 'html',
'value' => 'helpers::TruncateText($data->nomMessageLangue->texte_quod,50)',
'header' => 'nom',
),
array(
'name' => 'modif_msg',
'type' => 'html',
'value' => 'CHtml::image(helpers::evaluateTrick())',
'header' => 'modifiable',
),
and that is working fine ! I had difficulty to render a image and with ‘type’ => ‘html’, it’is ok, too !
Thank you for your help !
Rupali_v
(Rupali v)
February 18, 2021, 9:05am
7
yes its helpful… but in view only. not for database… in database html tags are not remove