mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-10 23:32:15 +00:00
Development
- Removed yet another depricated method. - Fixed $_GET parameters being merged on default when calling getUrl. - Fixed double / that could appear on urls sometimes.
This commit is contained in:
@@ -306,37 +306,12 @@ class SimpleRouter
|
||||
* You can also use the same syntax when searching for a specific controller-class "MyController@home".
|
||||
* If no arguments is specified, it will return the url for the current loaded route.
|
||||
*
|
||||
* This method is an alias for SimpleRouter::getUrl().
|
||||
*
|
||||
* @see SimpleRouter::getUrl()
|
||||
* @param string|null $name
|
||||
* @param string|array|null $parameters
|
||||
* @param array|null $getParams
|
||||
* @return string
|
||||
*/
|
||||
public static function getRoute($name = null, $parameters = null, array $getParams = null)
|
||||
{
|
||||
return static::getUrl($name, $parameters, $getParams);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get url for a route by using either name/alias, class or method name.
|
||||
*
|
||||
* The name parameter supports the following values:
|
||||
* - Route name
|
||||
* - Controller/resource name (with or without method)
|
||||
* - Controller class name
|
||||
*
|
||||
* When searching for controller/resource by name, you can use this syntax "route.name@method".
|
||||
* You can also use the same syntax when searching for a specific controller-class "MyController@home".
|
||||
* If no arguments is specified, it will return the url for the current loaded route.
|
||||
*
|
||||
* @param string|null $name
|
||||
* @param string|array|null $parameters
|
||||
* @param array|null $getParams
|
||||
* @return string
|
||||
*/
|
||||
public static function getUrl($name = null, $parameters = null, array $getParams = null)
|
||||
public static function getUrl($name = null, $parameters = null, $getParams = [])
|
||||
{
|
||||
return static::router()->getUrl($name, $parameters, $getParams);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user