public function addSubtype(\Labcoat\Sections\SubtypeInterface $subtype) { $segments = explode(DIRECTORY_SEPARATOR, $subtype->getPath()); $name = array_pop($segments); $this->subtypes[$name] = new Subtype($subtype); ksort($this->subtypes); }
public function __construct(SubtypeInterface $subType) { $this->partial = str_replace('/', '-', $subType->getNormalizedPath()); $this->path = str_replace(DIRECTORY_SEPARATOR, '-', $subType->getPath()); }
/** * @param SubtypeInterface $subtype */ protected function addSubtypeIndexPath(SourceSubtype $subtype) { $names = explode('/', $subtype->getNormalizedPath()); list($type, $name) = $names; if (!isset($this->indexPaths[$type])) { $segments = explode(DIRECTORY_SEPARATOR, $subtype->getPath()); $typePath = array_shift($segments); $this->indexPaths[$type] = ['all' => $typePath]; ksort($this->indexPaths); } $this->indexPaths[$type][$name] = $this->makeItemPath($subtype); ksort($this->indexPaths[$type]); }
public function __construct(SourceInterface $subtype) { list($this->type, $this->subtype) = explode(DIRECTORY_SEPARATOR, $subtype->getPath()); $this->partial = Navigation::escapePath($subtype->getNormalizedPath()); $this->path = Navigation::escapePath($subtype->getPath()); }