【问题标题】:Append some html text to a Yii Widget将一些 html 文本附加到 Yii 小部件
【发布时间】:2014-06-30 13:39:29
【问题描述】:

我有以下 Yii 小部件,并想在项目迭代之前和之后传递一些 html - 谁能解释我是如何做到的?

$this->widget('application.widgets.zii.ListViewShowAll', array(
'summaryText' => false,
    'template' => '{items}',
    'htmlOptions' => array(),
    'itemView' => 'application.views.widgets.account.prizes._mainprizeItem',

);

【问题讨论】:

  • 这是每次使用小部件时还是仅单个实例?如果只是一次,只需在调用此小部件代码之前和之后将其放在您的视图中。
  • 我发现模板可以在 {items} 占位符之前和之后传递 html - 感谢您的帮助,但仍不胜感激

标签: php yii frameworks widget


【解决方案1】:

刚刚修改了上面的小部件代码...

'template' => '{<p>someting</p> items <p>more text</p>}',

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-04-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-01
    • 1970-01-01
    • 2012-10-06
    相关资源
    最近更新 更多