Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 public function addJs($path, $local = true, $filter = null, $attributes = null)
 {
     foreach ($this->getJs()->getResources() as $resource) {
         if ($resource->getPath() === $path) {
             return $this;
         }
     }
     return parent::addJs($path, $local, $filter, $attributes);
 }
Esempio n. 2
0
 public function addJs($path, $local = true, $filter = true, $attributes = null)
 {
     return parent::addJs($path, $local, $filter, $attributes);
 }
Esempio n. 3
0
};
/**
 * Setting up the view component
 */
$di['view'] = function () {
    $view = new View();
    $view->registerEngines(array(".volt" => function ($view, $di) {
        $volt = new VoltEngine($view, $di);
        $volt->setOptions(array("compiledPath" => __DIR__ . '/../cache/volt/', "compiledSeparator" => "-"));
        return $volt;
    }));
    return $view;
};
$di['assets'] = function () {
    $assets = new AssetsManager();
    $assets->addJs('//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js', false)->addJs('//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js', false);
    $assets->addCss('css/bootstrap.min.css')->addCss('css/style.css');
    return $assets;
};
$di['router'] = function () {
    //Use the annotations router
    $router = new Router(false);
    //Read the resources from file
    require __DIR__ . '/routes.php';
    return $router;
};
$di['modelsManager'] = function () {
    $eventsManager = new EventsManager();
    $modelsManager = new ModelsManager();
    $modelsManager->setEventsManager($eventsManager);
    //Attach a listener to models-manager
Esempio n. 4
0
 public function addJs($path, $local = true, $filter = true, $attributes = null)
 {
     $path = $local ? $this->getFullJsPath() . $path : $path;
     return parent::addJs($path, $local, $filter, $attributes);
 }
Esempio n. 5
0
 public function requireJs($path, $local = true, $filter = true, $attributes = null)
 {
     if (!array_key_exists($path, $this->stackJs)) {
         $this->stackJs[$path] = array('local' => $local, 'filter' => $filter, 'attributes' => $attributes);
         parent::addJs($path, $local, $filter, $attributes);
     }
 }