@route() directive.
<?php
...
use Window;
Home extends Window {
function __construct() {
self::loadRoutes($this);
echo route('homeUser'); // home/user
}
static function addRoute(array $array = []) : array {
return [
'homeUser' => 'home/user'
];
}
}
route() function makes it easy to get the value of the named route using the
specified route name just as shown above.