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
,我应该怎么做呢?