Пример #1
0
 public function __construct($type, $base, $action, $format = 'html', $arguments = '')
 {
     $this->setBase($base);
     $this->setAction($action);
     $this->setFormat($format);
     $this->setArguments($arguments);
     parent::__construct($type);
 }
Пример #2
0
 public function __construct($type, $filename)
 {
     $this->setFilename($filename);
     parent::__construct($type);
 }
Пример #3
0
 public function __construct($type, $url, $arguments = '')
 {
     $this->setUrl($url);
     $this->setArguments($arguments);
     parent::__construct($type);
 }
Пример #4
0
 public function addResource(Resource $resource, $position = self::RESOURCE_POSITION_DEFAULT)
 {
     if ($position == self::RESOURCE_POSITION_TOP) {
         $resource->setPosition(self::RESOURCE_POSITION_FIRST);
     } else {
         $resource->setPosition($position);
     }
     // Check for duplicates
     // TODO: another option, replace current resource
     foreach ($this->_resources as $positionArray) {
         foreach ($positionArray as $item) {
             if ((string) $item == (string) $resource) {
                 return false;
             }
         }
     }
     if ($position === self::RESOURCE_POSITION_TOP) {
         array_unshift($this->_resources[self::RESOURCE_POSITION_FIRST], $resource);
     } else {
         $this->_resources[$position][] = $resource;
     }
     // Add to cache
     if ($resource instanceof Local) {
         Cache::getInstance()->addFile($resource->getFilename());
     }
     return true;
 }