Function : Route

This function is used in routes to get the value of a named route. The equivalent template directive is @route() directive.

Assuming we have a sample route:
sample route: Home
  <?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'

      ];

    }


  }
                  
The route() function makes it easy to get the value of the named route using the specified route name just as shown above.