Reference

Guide

URLs

Modify all URLs

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

Parameters

Name Type Default Description
$kirby Kirby\Cms\App

Kirby instance

$path string

URL path

$options array|null

Array of options for the Uri class

$originalHandler Closure

Callback function to the original URL handler with $path and $options as parameters

Return type

string

Source code

kirby/config/components.php#L228