Yii Framework Forum: Cara Meng-Link-An Pada Yii Twitter Bootstrap - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Cara Meng-Link-An Pada Yii Twitter Bootstrap Rate Topic: -----

#1 User is offline   alienwerks 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 29-October 12

Posted 01 July 2013 - 06:59 PM

Pagi semua,

Saya mau nanya dikit nih, saya nyoba contoh widget CJuiDialog, semua jalan baik2 saja, tapi ketika saya coba ganti widget dengan widget Twitter Bootstrap,
<?php echo CHtml::link('Open Dialog', '#', array('onclick'=>'$("#mydialog").dialog("open"); return false;',));?>
tidak jalan kecuali saya ganti dengan
<?php $this->widget('bootstrap.widgets.TbButton', array(
    'label'=>'Open Dialog',
    'type'=>'primary',
    'htmlOptions'=>array(
        'data-toggle'=>'modal',
        //'data-target'=>'#myModal',
    ),
)); ?>
.

Saya pengennya link biasa bukan TbButton, gimana caranya biar CHtml::linknya jalan?

Berikut full code nya
<?php
/** Start Widget **/
//$this->beginWidget('zii.widgets.jui.CJuiDialog',array(
//    'id'=>'mydialog',
//    'options'=>array(
//        'title'=>'Dialog box',
//        'autoOpen'=>false,
//	),
//));
$this->beginWidget('bootstrap.widgets.TbModal', array('id'=>'myModal')); 
//echo 'dialog content here';
?>
<div class="modal-header">
	<a class="close" data-dismiss="modal">&times;</a>
	<h4>Modal Header Part</h4>
</div>

<div class="modal-body"><p>One Fine Body...</p></div>
<div class="modal-footer">
 <?php $this->widget('bootstrap.widgets.TbButton', array(
        'type'=>'primary',
        'label'=>'Save changes',
        'url'=>'#',
        'htmlOptions'=>array('data-dismiss'=>'modal'),
    )); ?>
    <?php $this->widget('bootstrap.widgets.TbButton', array(
        'label'=>'Close',
        'url'=>'#',
        'htmlOptions'=>array('data-dismiss'=>'modal'),
    )); ?>
</div>
<?php
//$this->endWidget('zii.widgets.jui.CJuiDialog');
$this->endWidget();
/** End Widget **/
?>
<?php echo CHtml::link('Open Dialog', '#', array('onclick'=>'$("#mydialog").dialog("open"); return false;',));?>






Salam
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users