to() public static method
Creates a URL based on the given parameters. This method is very similar to toRoute(). The only difference is that this method requires a route to be specified as an array only. If a string is given, it will be treated as a URL. In particular, if $url is an array: toRoute() will be called to generate the URL. For example: ['site/index'], ['post/index', 'page' => 2]. Please refer to toRoute() for more details on how to specify a route. a string with a leading @: