Class humhub\modules\content\components\ContentContainerController

Inheritancehumhub\modules\content\components\ContentContainerController » humhub\components\Controller » yii\web\Controller
Subclasseshumhub\modules\activity\controllers\StreamController, humhub\modules\content\controllers\ContainerImageController, humhub\modules\content\controllers\MoveController, humhub\modules\post\controllers\PostController, humhub\modules\space\controllers\MembershipController, humhub\modules\space\controllers\SpaceController, humhub\modules\space\modules\manage\components\Controller, humhub\modules\space\modules\manage\controllers\DefaultController, humhub\modules\space\modules\manage\controllers\ImageController, humhub\modules\space\modules\manage\controllers\MemberController, humhub\modules\space\modules\manage\controllers\ModuleController, humhub\modules\space\modules\manage\controllers\SecurityController, humhub\modules\topic\controllers\ManageController, humhub\modules\topic\controllers\TopicController, humhub\modules\user\controllers\ImageController, humhub\modules\user\controllers\ProfileController

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).

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$access string Defines the ControllerAccess class for this controller responsible for managing access rules humhub\components\Controller

Public Methods

Hide inherited methods

MethodDescriptionDefined By
appendPageTitle() Append a page title. humhub\components\Controller
beforeAction() humhub\modules\content\components\ContentContainerController
behaviors() humhub\components\Controller
forcePostRequest() Throws HttpException in case the request is not an post request, otherwise returns true. humhub\components\Controller
getAccess() humhub\modules\content\components\ContentContainerController
htmlRedirect() Create Redirect for AJAX Requests which output goes into HTML content. humhub\components\Controller
init() humhub\modules\content\components\ContentContainerController
prependPageTitle() Prepend a page title. humhub\components\Controller
redirect() humhub\components\Controller
renderAjaxContent() humhub\components\Controller
renderContent() Renders a static string by applying the layouts (sublayout + layout. humhub\components\Controller
renderModalClose() Closes a modal humhub\components\Controller
setActionTitles() Set a map that indicates what page title should be shown for the currently active action. humhub\components\Controller
setJsViewStatus() Sets some ui state as current controller/module and active topmenu. humhub\components\Controller
setPageTitle() Set the page title. humhub\components\Controller

Protected Methods

Hide inherited methods

MethodDescriptionDefined 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

Hide inherited events

EventTypeDescriptionDefined By
EVENT_INIT \yii\base\Event An event raised on init a controller. humhub\components\Controller

Property Details

$contentContainer public property

The content container (e.g. Space or User record)

$requireContainer public property

Require cguid container parameter

public boolean $requireContainer true
$validContentContainerClasses public property (available since version 1.3)

An array of valid content container classes. if null all container types (User & Space) are allowed.

Method Details

beforeAction() public method

public void beforeAction ( $action )
$action
checkModuleIsEnabled() protected method

Checks if the requested module is available in this contentContainer.

protected void checkModuleIsEnabled ( )
throws \yii\web\HttpException

if the module is not enabled

getAccess() public method

public null|humhub\components\access\ControllerAccess getAccess ( )
return null|humhub\components\access\ControllerAccess

Returns an ControllerAccess instance

init() public method

public void init ( )