/** * Appends the required configs in a head script */ public function __invoke() { $namespaces = $this->bootstrap->getPaths(); if ($namespaces) { foreach ($namespaces as $namespace => $path) { if ($path[0] !== '/') { $namespaces[$namespace] = $this->basePath->__invoke($path); } } $data = array('enabled' => true, 'paths' => $namespaces); $this->headScript->appendScript('Ext.Loader.setConfig(' . json_encode($data) . ');'); } if ($requires = $this->bootstrap->getRequires()) { $this->headScript->appendScript('Ext.syncRequire(' . json_encode($requires) . ');'); } }