Yii Framework Forum: How To Interpreate Html Tags ? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How To Interpreate Html Tags ? Rate Topic: -----

#1 User is offline   nath-0 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 81
  • Joined: 12-October 12
  • Location:switzerland

Posted 19 November 2012 - 04:06 AM

Hello,

I have a field that is populate with a rich text editor.
So in the database I have for exemple:

Quote

<p><strong>L'enregistrement de la page a &eacute;t&eacute; effectu&eacute; avec succ&egrave;s.</strong></p>


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
0

#2 User is offline   Keith 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,645
  • Joined: 04-March 10
  • Location:UK

Posted 19 November 2012 - 04:10 AM

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?
0

#3 User is offline   nath-0 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 81
  • Joined: 12-October 12
  • Location:switzerland

Posted 19 November 2012 - 04:37 AM

View PostKeith, on 19 November 2012 - 04:10 AM, said:

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?



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 ;D

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
0

#4 User is offline   redguy 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 815
  • Joined: 02-July 10
  • Location:Central Poland

Posted 19 November 2012 - 05:34 AM

add 'type'=>'raw'
$this->widget( 'CGridView', array(
...
	'columns'=>array(
		array( 'name'=>'column', 'type'=>'raw' ),
...
	),
));

red
0

#5 User is offline   Keith 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,645
  • Joined: 04-March 10
  • Location:UK

Posted 19 November 2012 - 05:34 AM

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... >:(
0

#6 User is offline   nath-0 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 81
  • Joined: 12-October 12
  • Location:switzerland

Posted 19 November 2012 - 05:44 AM

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 !
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users