Gridview 函数 yii2 中的访问变量

是实际开发中,有这么一个场景,Gridview 怎么访问外部变量,

usevalue可调用函数中的函数签名后插入:

[
                            'header' => "操作",
                            'class' => 'yii\grid\ActionColumn',
                            'template'=> '{ajax-edit}',
                            'buttons' => [
                                'ajax-edit' => function ($url, $model, $key) use($package){
                                    return Html::a('关联项目', ['ajax-generate-add', 'id' => $model->id,'package_id' => $package->id], [
                                            'class' => 'orange',
                                            'data-toggle' => 'modal',
                                            'data-target' => '#ajaxModal',
                                        ]) . '<br>';
                                },
                            ],
                        ]
微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_2563.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?