Skip to content

Kirby 3.6.6

URLs

Modify all URLs

/site/plugins/urls/index.php
Kirby::plugin('my/urls', [
  'components' => [
    'url' => function (Kirby $kirby, string $path, array $options = []): string {
        $original = $kirby->nativeComponent('url');
        return $original($kirby, $path, $options);
    }
  ]
]);

Parameters

Name Type Default Description
$kirby * Kirby\Cms\App Kirby instance
$path string null URL path
$options array|string|null null Array of options for the Uri class

Return type

string