sxtuwy 2012-11-06 06:39:14 2845次浏览 2条回复 0 0 0

我想让它原样显示,不让它自动给html编码了。看了半天没有什么好的办法,谁有呢? [attach]980[/attach]

  • 回复于 2012-11-06 09:18 举报
    $this->widget('zii.widgets.CDetailView', array(
          'data'=>$model,
          'attributes'=>array(
              'title',             // title attribute (in plain text)
              'owner.name',        // an attribute of the related object "owner"
              'description:html',  // description attribute in HTML
              array(               // related city displayed as a link
                  'label'=>'City',
                  'type'=>'raw',
                  'value'=>CHtml::link(CHtml::encode($model->city->name),
                                       array('city/view','id'=>$model->city->id)),
              ),
          ),
      ));
    

    这是一个例子,特别是'description:html'。不清楚楼主的咋写的?

  • 回复于 2012-11-06 09:45 举报

    lilongsy 英明,果然如此。lilongsy 最热情了,顶一下。搜遍网络,我也找到一点。
    [attach]981[/attach]
    或者这么写(思路来源于lilongsy):'content:html',

您需要登录后才可以回复。登录 | 立即注册