示例#1
0
文件: Public.php 项目: nabble/ajde
 public function __construct($type, $filename, $arguments = '')
 {
     $url = ASSETS_URI . $type . '/' . $filename;
     $this->setUrl($url);
     $this->setArguments($arguments);
     parent::__construct($type);
 }
示例#2
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);
 }
示例#3
0
文件: Remote.php 项目: nabble/ajde
 public function __construct($type, $url, $arguments = '')
 {
     $this->setUrl($url);
     $this->setArguments($arguments);
     parent::__construct($type);
 }
示例#4
0
 public function __construct($type, $filename)
 {
     $this->setFilename($filename);
     parent::__construct($type);
 }
示例#5
0
文件: Html.php 项目: nabble/ajde
 public function addResource(Ajde_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 Ajde_Resource_Local) {
         Ajde_Cache::getInstance()->addFile($resource->getFilename());
     }
     return true;
 }