jQuery::init PHP Method

init() public method

Initialization
public init ( )
    public function init()
    {
        parent::init();
        $this->app->jquery = $this;
        if (!$this->app->template) {
            return;
        }
        if (!$this->app->template->is_set('js_include')) {
            throw $this->exception('Tag js_include must be defined in shared.html');
        }
        if (!$this->app->template->is_set('document_ready')) {
            throw $this->exception('Tag document_ready must be defined in shared.html');
        }
        $this->app->template->del('js_include');
        /* $config['js']['jquery']='https://code.jquery.com/jquery-2.1.4.min.js'; // to use CDN */
        if ($v = $this->app->getConfig('js/versions/jquery', null)) {
            $v = 'jquery-' . $v;
        } else {
            $v = $this->app->getConfig('js/jquery', 'jquery-2.2.1.min');
            // bundled jQuery version
        }
        $this->addInclude($v);
        // Controllers are not rendered, but we need to do some stuff manually
        $this->app->addHook('pre-render-output', array($this, 'postRender'));
        $this->app->addHook('cut-output', array($this, 'cutRender'));
    }

Usage Example

Ejemplo n.º 1
0
Archivo: jUI.php Proyecto: respond/atk4
 function init()
 {
     parent::init();
     $this->api->jui = $this;
     $this->addDefaultIncludes();
     $this->atk4_initialised = true;
 }
All Usage Examples Of jQuery::init