Note that there are some explanatory texts on larger screens.

plurals
  1. POReplacing TbButton with CHtml::link in Yii
    text
    copied!<p>My scenario is whenever client clicks on the link, twitter bootstrap modal will be displayed. So far, I modified widget CJuiDialog to become Bootstrap widget</p> <pre><code>&lt;?php /** Start Widget **/ //$this-&gt;beginWidget('zii.widgets.jui.CJuiDialog',array( // 'id'=&gt;'mydialog', // 'options'=&gt;array( // 'title'=&gt;'Dialog box', // 'autoOpen'=&gt;false, // ), //)); $this-&gt;beginWidget('bootstrap.widgets.TbModal', array('id'=&gt;'myModal')); //echo 'dialog content here'; ?&gt; &lt;div class="modal-header"&gt; &lt;a class="close" data-dismiss="modal"&gt;&amp;times;&lt;/a&gt; &lt;h4&gt;Modal Header Part&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt;&lt;p&gt;One Fine Body...&lt;/p&gt;&lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;?php $this-&gt;widget('bootstrap.widgets.TbButton', array( 'type'=&gt;'primary', 'label'=&gt;'Save changes', 'url'=&gt;'#', 'htmlOptions'=&gt;array('data-dismiss'=&gt;'modal'), )); ?&gt; &lt;?php $this-&gt;widget('bootstrap.widgets.TbButton', array( 'label'=&gt;'Close', 'url'=&gt;'#', 'htmlOptions'=&gt;array('data-dismiss'=&gt;'modal'), )); ?&gt; &lt;/div&gt; &lt;?php //$this-&gt;endWidget('zii.widgets.jui.CJuiDialog'); $this-&gt;endWidget(); /** End Widget **/ ?&gt; &lt;?php echo CHtml::link('Open Dialog', '#', array('onclick'=&gt;'$("#mydialog").dialog("open"); return false;',));?&gt; </code></pre> <p>But unfortunately it did not work, Does anyone know how to link using CHtml::link like in CJuiDialog? Instead of having bootstrap widget as below which is working fine</p> <pre><code>&lt;?php $this-&gt;widget('bootstrap.widgets.TbButton', array( 'label'=&gt;'Open Dialog', 'type'=&gt;'primary', 'htmlOptions'=&gt;array( 'data-toggle'=&gt;'modal', 'data-target'=&gt;'#myModal', ), )); ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload