我使用 yii-jui 在视图中添加一些 UI 元素,例如 datePicker。在frontend\config\main-local.php我设置以下内容来更改 JqueryUI 使用的主题:
$config = [
'components' => [
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => 'gjhgjhghjg87hjh8878878',
],
'assetManager' => [
'bundles' => [
'yii\jui\JuiAsset' => [
'css' =>
['themes/flick/jquery-ui.css'],
],
],
],
],
];
Run Code Online (Sandbox Code Playgroud)
我尝试了以下方法来覆盖控制器操作方法中的此配置项:
public function actions() {
Yii::$app->components['assetManager'] = [
'bundles' => [
'yii\jui\JuiAsset' => [
'css' =>
['themes/dot-luv/jquery-ui.css'],
],
],
]; …Run Code Online (Sandbox Code Playgroud)