【问题标题】:YII How to convert a CHtml::link into a bootstrap.widgets.BootButton?YII 如何将 CHtml::link 转换为 bootstrap.widgets.BootButton?
【发布时间】:2012-07-05 13:49:10
【问题描述】:

我遇到了一个小任务,我正在尝试将我在 YII 中编写的链接转换为 yii.bootstrap 按钮,但收效甚微。我在引导页面上的文档中寻找解决方案,但没有结果,所以我希望这里有人能指出我正确的方向。

所以链接的代码如下:

<?php echo CHtml::link(
        'delete', 
        '#', 
        array(
            'submit'=>'', 
            'params'=>array(
                'Price[command]'=>'delete', 
                'Price[id]'=>$id, 
                'noValidate'=>true)
            ));?>

yiibotstrap按钮的代码如下:

 <?php $this->widget('bootstrap.widgets.BootButton', array(
            'buttonType'=>'submit', 
            'type'=>'primary', 
            'icon'=>'ok white',
            'label'=>'Submit',
            // '', 'large', 'small' or 'mini'
)); ?>

顺便说一下我在YII中编程(php框架)

【问题讨论】:

  • 哪个扩展?你可以添加链接吗?因为有许多具有相似功能的扩展
  • 您是否遇到任何错误?输出是什么?你想让我们猜吗?

标签: arrays twitter-bootstrap yii


【解决方案1】:

试试这个。

<?php $this->widget('bootstrap.widgets.BootButton', array(
            'buttonType'=>'submitLink', 
            'type'=>'primary', 
            'icon'=>'ok white',
            'label'=>'Submit',
            'htmlOptions'=>array(
              'submit'=>'', 
              'params'=>array(
                'Price[command]'=>'delete', 
                'Price[id]'=>$id, 
                'noValidate'=>true)
            ),
)); ?>

【讨论】:

  • 任何想法我怎么能把它变成一个 buutButton ; $this->widget('Relation', array('model' => $model, 'relation' => 'products', 'parentObjects' => Product::model()->findAll('id_contract='.$ model->id_contract), 'fields' => 'product_name', 'showAddButton' => false, ));
  • 什么是Relation?我没有找到任何名为 Relation 的小部件类
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多