Final Class Yiisoft\Yii\DataView\YiiRouter\UrlCreator
| Inheritance | Yiisoft\Yii\DataView\YiiRouter\UrlCreator |
|---|
URL creator for list views that generates URLs based on the current route.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Creates a new URL creator instance. | Yiisoft\Yii\DataView\YiiRouter\UrlCreator |
| __invoke() | Generates a URL based on the current route with modified parameters. | Yiisoft\Yii\DataView\YiiRouter\UrlCreator |
Method Details
Creates a new URL creator instance.
| public __construct( \Yiisoft\Router\UrlGeneratorInterface $urlGenerator ): mixed | ||
| $urlGenerator | \Yiisoft\Router\UrlGeneratorInterface |
The URL generator service used to generate URLs from the current route. |
public function __construct(
private readonly UrlGeneratorInterface $urlGenerator,
) {}
Generates a URL based on the current route with modified parameters.
| public __invoke( array $arguments, array $queryParameters ): string | ||
| $arguments | array |
Route arguments to override in the current route. |
| $queryParameters | array |
Query parameters to append to the URL. |
| return | string |
The generated URL with the specified modifications. |
|---|---|---|
public function __invoke(array $arguments, array $queryParameters): string
{
return $this->urlGenerator->generateFromCurrent($arguments, $queryParameters);
}
Signup or Login in order to comment.