YII How to convert a CHtml::link into a bootstrap.widgets.BootButton?

i came across a little quest i am trying to convert this link that i worte in YII into a yii.bootstrap button but with very little success. I looked for a solution in the documentation on the bootstrap page but with no results so iam hoping someone here will point me in the right direction.

so the code for the link is as follows :

<?php echo CHtml::link(

    'delete', 


    '#', 


    array(


        'submit'=&gt;'', 


        'params'=&gt;array(


            'Price[command]'=&gt;'delete', 


            'Price[id]'=&gt;&#036;id, 


            'noValidate'=&gt;true)


        ));?&gt;

The code for the yiibotstrap button is as follows :

<?php $this->widget(‘bootstrap.widgets.BootButton’, array(

        'buttonType'=&gt;'submit', 


        'type'=&gt;'primary', 


        'icon'=&gt;'ok white',


        'label'=&gt;'Submit',


        // '', 'large', 'small' or 'mini'

)); ?>

By the way iam programming in YII (php framework)

I’m not sure, but have you tried something like :




<?php $this->widget('bootstrap.widgets.BootButton', array(

    'label'=>'Submit',

    'buttonType' => 'link',

    'url'=>array('#', 'Price[command]'=>'delete', 'Price[id]'=>$id, 'noValidate'=>true),

    'type'=>'primary',

    'icon'=>'ok white',

)); ?>



But if your button is really a submit button, then it should be inside a form and automatically send the parameters from the form. Hope this helps…

Cheers,

fatz

Thanks for your reply your approach works i just tried it out but if anyone else is interested in the following way it also works <?php

$this->widget(‘bootstrap.widgets.BootButton’, array(

                    'buttonType'=&gt;'submitLink', 


                    'type'=&gt;'danger', 


                    'icon'=&gt;'trash',


                    'label'=&gt;'Delete',


                    'htmlOptions'=&gt;array(


                        'submit'=&gt;'', 


                        'params'=&gt;array(


                            'Price[command]'=&gt;'delete', 


                            'Price[id]'=&gt;&#036;id, 


                            'noValidate'=&gt;true)


                        ),


        )); ?&gt;

i have an even more challanging question how could i convert the following code into a bootstrap button :

$this->widget(‘Relation’, array(

            'model' =&gt; &#036;model,


            'relation' =&gt; 'products',


            'parentObjects' =&gt; Product::model()-&gt;findAll('id_contract='.&#036;model-&gt;id_contract),


            'fields' =&gt; 'product_name',


            'showAddButton' =&gt; false,


        ));?&gt;