0
我創建的Yii 2 GridView中象下面這樣:與HTML :: Yii中按鈕的工作2
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\ActionColumn'],
['class' => 'kartik\grid\SerialColumn'],
['class' => 'kartik\grid\CheckboxColumn'],
'id',
'countrydate',
'countryCode'=>[
'attribute'=>'countryCode',
'content' => function($model,$key,$index, $column) {
return Html::button($model->countryCode,$options = [
'onclick'=>'showcountryCode('.$key.')',
'id'=>'countryCode'.$key,
'class'=>'popup',
]);
}
],
'countryName',
'countrydate',
'population',
'fipsCode',
],
,我用我的cutson設置爲
'countryCode'=>[
'attribute'=>'countryCode',
'content' => function($model,$key,$index, $column) {
return Html::button($model->countryCode,$options = [
'onclick'=>'showcountryCode('.$key.')',
'id'=>'countryCode'.$key,
'class'=>'popup',
]);
}
],
你知道我們可以有內部標籤海誓山盟在這樣的HTML:
<a> <h1> asdas </h1> </a>
現在我想提出另一個標籤內Html::button
,我應該怎麼做呢?