public function __construct(PHPSTLTemplateProvider $provider, $resource, $identifier) { parent::__construct($provider, $resource, $identifier); $this->path = new StupidPath(Site::Site()->url); if (substr($identifier, 0, 7) == 'file://') { $path = dirname(substr($identifier, 7)); $pl = strlen($path); foreach (array(Loader::$FrameworkPath . '/', Loader::$Base . '/') as $p) { $l = strlen($p); if ($pl > $l && substr($path, 0, $l) == $p) { $this->path = $this->path->down(substr($path, $l)); break; } } } }
/** * Descends into bothp and url and returns a new self * * @see StupidPath::down */ public function down() { $args = func_get_args(); return new self($this->path->down($args), $this->url->down($args)); }