Here is a part of a field. I set the $assets
array to contain a css file. It works when using the static public variable. It does not work when I try to do the same thing with the __construct
. Any idea why?
class MyField extends TagsField {
static public $assets = array(
'css' => array(
'style.css',
)
);
public function __construct() {
self::$assets = array(
'css' => array(
'new-style.css'
)
);
}
}
What I really want to do is to have an if statement. If a config value is something, don’t load the css file at all.
I guess it has to do with static variables or some PHP that prevents my construct from setting or overriding the set variable?