File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -205,6 +205,11 @@ public static function endTag($name)
205
205
*/
206
206
public static function style ($ content , $ options = [])
207
207
{
208
+ $ view = Yii::$ app ->getView ();
209
+ if ($ view instanceof \yii \web \View && !empty ($ view ->styleOptions )) {
210
+ $ options = array_merge ($ view ->styleOptions , $ options );
211
+ }
212
+
208
213
return static ::tag ('style ' , $ content , $ options );
209
214
}
210
215
Original file line number Diff line number Diff line change @@ -120,6 +120,13 @@ class View extends \yii\base\View
120
120
* @see registerCssFile()
121
121
*/
122
122
public $ cssFiles = [];
123
+
124
+ /**
125
+ * @since 2.0.52
126
+ * @var array the style tag options.
127
+ */
128
+ public $ styleOptions = [];
129
+
123
130
/**
124
131
* @var array the registered JS code blocks
125
132
* @see registerJs()
You can’t perform that action at this time.
0 commit comments