HumHub Documentation (unofficial)

ContentContainerUrlRuleInterface

ContentContainerUrlRuleInterface is the interface that should be implemented by URL rule classes which handle routes under Content Container path.

For example, if URL /s/space-url-name/module-id/<title> should be routed to /module-id/controller/action?title=<title>

Tags
author

luke

since
1.9

Table of Contents

Methods

createContentContainerUrl()  : string|bool
Creates a URL according under the Content Container (Space/User) route and parameters.
parseContentContainerRequest()  : array<string|int, mixed>|bool
Parses the request under Content Container (Space/User) and returns the corresponding route and parameters.

Methods

createContentContainerUrl()

Creates a URL according under the Content Container (Space/User) route and parameters.

public createContentContainerUrl(UrlManager $manager, string $containerUrlPath, string $route, array<string|int, mixed> $params) : string|bool
Parameters
$manager : UrlManager

the URL manager

$containerUrlPath : string

Current relative URL path to the Content Container

$route : string

the route. It should not have slashes at the beginning or the end.

$params : array<string|int, mixed>

the parameters

Return values
string|bool

the created URL, or false if this rule cannot be used for creating this URL.

parseContentContainerRequest()

Parses the request under Content Container (Space/User) and returns the corresponding route and parameters.

public parseContentContainerRequest(ContentContainerActiveRecord $container, UrlManager $manager, string $containerUrlPath, array<string|int, mixed> $urlParams) : array<string|int, mixed>|bool
Parameters
$container : ContentContainerActiveRecord

Content Container (Space/User)

$manager : UrlManager

the URL manager

$containerUrlPath : string

Current relative URL path to the Content Container

$urlParams : array<string|int, mixed>

Additional GET params of the current request

Return values
array<string|int, mixed>|bool

the parsing result. The route and the parameters are returned as an array. If false, it means this rule cannot be used to parse this path info.


        
On this page

Search results