0
我想將一個php變量傳遞給模態窗口,我正在做的是使用此鏈接打開模態窗口,但是我想將變量傳遞給此鏈接並在模態窗口獲得相同的變量,我嘗試這樣做是爲了追加一些DIV文本,但它返回的HTML,我無法查詢如何通過鏈接將PHP變量傳遞給yiibooster模態窗口
echo CHtml::link(
'Set Recipe', '', array(
'class' => 'testclass',
'id' => $finalDate,
'data-toggle' => 'modal',
'data-target' => '#myModal',
'fahadVar' => $finalDate
));
得到,當我點擊這個按鈕,我得到了模態窗口如何得到變量設置在按鈕 這裏是簡單的模態代碼yiibooster
<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(); ?>
在此先感謝