Themosis\Asset\Asset::__construct PHP Method

__construct() public method

Build an Asset instance.
public __construct ( string $type, array $args, Themosis\Hook\IHook $action, HtmlBuilder $html, Themosis\Hook\IHook $filter )
$type string
$args array
$action Themosis\Hook\IHook
$html Themosis\Html\HtmlBuilder
$filter Themosis\Hook\IHook
    public function __construct($type, array $args, IHook $action, HtmlBuilder $html, IHook $filter)
    {
        $this->type = $type;
        $this->args = $this->parse($args);
        $this->key = strtolower(trim($args['handle']));
        $this->action = $action;
        $this->html = $html;
        $this->filter = $filter;
        $this->registerInstance();
        // Listen to WordPress asset events.
        $action->add('wp_enqueue_scripts', [$this, 'install']);
        $action->add('admin_enqueue_scripts', [$this, 'install']);
        $action->add('login_enqueue_scripts', [$this, 'install']);
        $action->add('customize_preview_init', [$this, 'install']);
    }