2012-07-05 33 views
2

我遇到了一个小小的任务,我试图将这个链接,我在YII worte转换成yii.bootstrap按钮,但很少成功。我在bootstrap页面的文档中查找了一个解决方案,但没有结果,所以我希望这里有人会指出我正确的方向。YII如何将CHtml :: link转换为bootstrap.widgets.BootButton?

所以该链接的代码如下:

<?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的框架)方式的IAM编程

+0

哪个扩展名?你可以添加链接吗?因为有许多类似功能的扩展 – 2012-07-05 13:51:42

+1

http://www.cniska.net/yii-bootstrap/#bootButton这是扩展 – Gunnit 2012-07-05 14:21:57

+0

你会得到任何错误?输出是什么?你想让我们猜测它? – 2012-07-05 14:36:12

回答

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) 
      ), 
)); ?> 
+0

作品像一个魅力感谢队友 – Gunnit 2012-07-05 15:07:42

+0

任何想法如何我可以把它变成buutButton; $ this-> widget('Relation',array( 'model'=> $ model, 'relation'=>'products', 'parentObjects'=> Product :: model() - > findAll('id_contract = '。$ model-> id_contract), 'fields'=>'product_name', 'showAddButton'=> false, )); – Gunnit 2012-07-06 08:20:08

+0

什么是“关系”?我没有找到任何名为'关系'的小部件类 – dInGd0nG 2012-07-06 17:51:08

相关问题