我设法合并了两列。但搜索栏不见了。如何添加搜索栏? 这是代码:
echo GridView::widget([
'dataProvider' => $dataProviderAcad,
'filterModel' => $searchModelAcad,
'columns' => [
'prog_and_remark_combined' => [
'format' => 'raw',
'label' => "Programme Name",
'value' => function ($data) {
return nl2br(
$data->NAME_PROG_ENG .
"\r\nPreviously known as: " .
$data->REMARKS
);
}
],
在 AcadSearch 类中为 prog_and_remark_combined 添加一个公共变量
class YourModelAcadSearch extends YourModelAcad
{
public $prog_and_remark_combined;
/**
* @inheritdoc
*/
public function rules()
{
return [
....