public function CollectPathsEvent::replacePath in Tome 8
Replaces a single path.
Parameters
string $path: The path to replace.
string $new_path: The new path.
array $metadata: (Optional) Metadata for this path.
File
- modules/
tome_static/ src/ Event/ CollectPathsEvent.php, line 91
Class
- CollectPathsEvent
- Wraps an array of paths that will be processed by the static generator.
Namespace
Drupal\tome_static\EventCode
public function replacePath($path, $new_path, array $metadata = []) {
if (isset($this->paths[$path])) {
unset($this->paths[$path]);
$this->paths[$new_path] = $metadata;
}
}