Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function addCss($path, $local = true, $filter = null, $attributes = null)
 {
     foreach ($this->getCss()->getResources() as $resource) {
         if ($resource->getPath() === $path) {
             return $this;
         }
     }
     return parent::addCss($path, $local, $filter, $attributes);
 }
Ejemplo n.º 2
0
 public function addCss($path, $local = true, $filter = true, $attributes = null)
 {
     return parent::addCss($path, $local, $filter, $attributes);
 }
Ejemplo 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
    $eventsManager->attach('modelsManager', new AnnotationsInitializer());
Ejemplo n.º 4
0
 public function addCss($path, $local = true, $filter = true, $attributes = null)
 {
     $path = $local ? $this->getFullCssPath() . $path : $path;
     return parent::addCss($path, $local, $filter, $attributes);
 }
Ejemplo n.º 5
0
 public function requireCss($path, $local = true, $filter = true, $attributes = null)
 {
     if (!array_key_exists($path, $this->stackCss)) {
         $this->stackCss[$path] = array('local' => $local, 'filter' => $filter, 'attributes' => $attributes);
         parent::addCss($path, $local, $filter, $attributes);
     }
 }