Exemplo n.º 1
0
    /**
     * Registers this asset bundle with a view.
     * @param View $view the view to be registered with
     * @return static the registered asset bundle instance
     */
    public function registerAssetFiles($view)
    {
        parent::registerAssetFiles($view);
        $view->registerJs(<<<JS
        (function(sx, \$, _)
        {
            sx.init({});
        })(sx, sx.\$, sx._);
JS
);
    }
Exemplo n.º 2
0
    /**
     * Registers this asset bundle with a view.
     * @param View $view the view to be registered with
     * @return static the registered asset bundle instance
     */
    public function registerAssetFiles($view)
    {
        parent::registerAssetFiles($view);
        $options = ['notify' => ['imageError' => \Yii::$app->getAssetManager()->getAssetUrl($this, 'js/components/notify/images/error.png'), 'imageFail' => \Yii::$app->getAssetManager()->getAssetUrl($this, 'js/components/notify/images/fail.gif'), 'imageInfo' => \Yii::$app->getAssetManager()->getAssetUrl($this, 'js/components/notify/images/info.png'), 'imageSuccess' => \Yii::$app->getAssetManager()->getAssetUrl($this, 'js/components/notify/images/success.png'), 'imageWarning' => \Yii::$app->getAssetManager()->getAssetUrl($this, 'js/components/notify/images/warning.png')]];
        $options = Json::encode($options);
        $view->registerJs(<<<JS
        (function(sx, \$, _)
        {
            sx.config.merge({$options});
        })(sx, sx.\$, sx._);
JS
);
    }