V
V
Viktor2019-03-02 17:12:35
JavaScript
Viktor, 2019-03-02 17:12:35

How to connect statics to a plugin in october cms?

I am making two plugins for october cms. They have dependencies on js libraries. In particular, the dependence on jquery ui and a few more libs.
How to make it so that when adding components from these two plugins to one page, jquery ui does not load twice?
Here is the component code.

class ImbaChat extends \Cms\Classes\ComponentBase {

    public function onRun() {
        $this->addJs('/plugins/imbachat/imbachat/assets/js/lib/jquery-ui-1.12.1.custom/jquery-ui.min.js');  
        .....
    } 
}

In it, I added a jquery-ui dependency and another plugin will have the same dependency. But in advance, I kind of don’t know if they will both be installed or not.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question