【发布时间】:2013-05-08 11:42:38
【问题描述】:
我正在使用带有 YiiBooster 扩展的 Yii。我想要一个这样的弹出窗口:
array(
'header' => '',
'value' => function($data)
{
$this->widget('bootstrap.widgets.TbButton', array(
'label'=>'Inne',
'type'=>'primary',
'size' => 'mini',
'htmlOptions'=>array(
'data-placement'=>'right',
'data-content'=> "Controller::renderPartial('_statButtons',
array('data' => $data->idProject));",
'rel'=>'popover'
),
));
}
),
这是在 gridview 的单元格内。我想使用renderPartial 来呈现包含一些内容的文件,但上面的代码不起作用。我怎样才能实现它?
编辑: 如果代码执行(我的代码或@Ruslans 代码)它就是结果:
Here is the text from the _statButtons partial file. End of this file.
<a id="yw2" class="btn btn-primary btn-mini" rel="popover"
data-placement="right" data-original-title="" title="">Inne</a>
【问题讨论】:
-
以上代码会引发什么错误?
-
完全没有错误。上面的方式:它只是将代码作为文本放置。如果我删除
"- 它不会呈现在data-content内,而是呈现为放置在按钮之前的文本。
标签: twitter-bootstrap yii popover renderpartial