/**
  * Check whether a session variable is set in an application context
  *
  * @param string $index
  * @return boolean
  */
 public function has($index)
 {
     if (!$this->is_started) {
         $this->start();
     }
     $name = $this->getName($index);
     if (isset($this->_data[$name])) {
         return true;
     }
     return $this->cache->exists($name);
 }
Exemple #2
0
 /**
  * Prints the HTML for CSS resources.
  *
  * @param string $collectionName the name of the collection
  *
  * @return string
  **/
 public function outputCss($collectionName = self::DEFAULT_COLLECTION_CSS)
 {
     $remote = $this->_config->application->assets->get('remote');
     $collection = $this->collection($collectionName);
     if (!$remote && $collection->getJoin()) {
         $local = $this->_config->application->assets->get('local');
         $lifetime = $this->_config->application->assets->get('lifetime', 0);
         $filepath = $local . self::GENERATED_STORAGE_PATH . ($filename = $filename = $this->getCollectionFileName($collection, self::FILENAME_PATTERN_CSS));
         $collection->setTargetPath($filepath)->setTargetUri($filepath);
         if ($this->_cache->exists($filename)) {
             return Tag::stylesheetLink($collection->getTargetUri());
         }
         $res = parent::outputCss($collectionName);
         $this->_cache->save($filename, true, $lifetime);
         return $res;
     }
     return parent::outputCss($collectionName);
 }