Class humhub\modules\content\components\ContentContainerController
Controller is the base class of web controllers which acts in scope of a ContentContainer (e.g. Space or User).
To automatically load the current contentcontainer the containers guid must be passed as GET parameter 'cguid'. You can create URLs in the scope of an ContentContainer by passing the contentContainer instance as 'container' or 'contentContainer' as parameter to the URLManager.
Example:
$url = Url::to(['my/action', 'container' => $this->contentContainer');
Based on the current ContentContainer a behavior (defined in ContentContainerActiveRecord::controllerBehavior) will be automatically attached to this controller instance.
The attached behavior will perform basic access checks, adds the container sublayout and perform other tasks (e.g. the space behavior will update the last visit membership attribute).
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$actionTitlesMap | array | Page titles | humhub\components\Controller |
$contentContainer | humhub\modules\content\components\ContentContainerActiveRecord | The content container (e.g. Space or User record) | humhub\modules\content\components\ContentContainerController |
$pageTitle | string | Title of the rendered page | humhub\components\Controller |
$prependActionTitles | boolean | Append page title | humhub\components\Controller |
$requireContainer | boolean | Require cguid container parameter | humhub\modules\content\components\ContentContainerController |
$subLayout | null|string | The name of the sub layout to be applied to this controller's views. | humhub\components\Controller |
$validContentContainerClasses | array|null | An array of valid content container classes. | humhub\modules\content\components\ContentContainerController |
Protected Properties
Property | Type | Description | Defined By |
---|---|---|---|
$access | string | Defines the ControllerAccess class for this controller responsible for managing access rules | humhub\components\Controller |
Public Methods
Protected Methods
Method | Description | Defined By |
---|---|---|
checkModuleIsEnabled() | Checks if the requested module is available in this contentContainer. | humhub\modules\content\components\ContentContainerController |
forbidden() | humhub\components\Controller | |
getAccessRules() | Returns access rules for the standard access control behavior. | humhub\components\Controller |
Events
Event | Type | Description | Defined By |
---|---|---|---|
EVENT_INIT | \yii\base\Event | An event raised on init a controller. | humhub\components\Controller |
Property Details
The content container (e.g. Space or User record)
Require cguid container parameter
An array of valid content container classes. if null all container types (User & Space) are allowed.
Method Details
public void beforeAction ( $action ) | ||
$action |
Checks if the requested module is available in this contentContainer.
protected void checkModuleIsEnabled ( ) | ||
throws | \yii\web\HttpException | if the module is not enabled |
---|
public null|humhub\components\access\ControllerAccess getAccess ( ) | ||
return | null|humhub\components\access\ControllerAccess | Returns an ControllerAccess instance |
---|
public void init ( ) |