Class humhub\components\Controller

Inheritancehumhub\components\Controller » yii\web\Controller
Subclasseshumhub\controllers\ErrorController, humhub\controllers\HomeController, humhub\controllers\MarkdownController, humhub\controllers\OembedController, humhub\modules\activity\controllers\AdminController, humhub\modules\activity\controllers\LinkController, humhub\modules\activity\controllers\StreamController, humhub\modules\activity\controllers\UserController, humhub\modules\admin\components\Controller, humhub\modules\admin\controllers\ApprovalController, humhub\modules\admin\controllers\AuthenticationController, humhub\modules\admin\controllers\GroupController, humhub\modules\admin\controllers\IndexController, humhub\modules\admin\controllers\InformationController, humhub\modules\admin\controllers\LoggingController, humhub\modules\admin\controllers\ModuleController, humhub\modules\admin\controllers\PendingRegistrationsController, humhub\modules\admin\controllers\SettingController, humhub\modules\admin\controllers\SpaceController, humhub\modules\admin\controllers\UserController, humhub\modules\admin\controllers\UserProfileController, humhub\modules\comment\controllers\CommentController, humhub\modules\content\components\ContentAddonController, humhub\modules\content\components\ContentContainerController, humhub\modules\content\controllers\ContainerImageController, humhub\modules\content\controllers\ContentController, humhub\modules\content\controllers\MoveController, humhub\modules\content\controllers\PermaController, humhub\modules\dashboard\controllers\DashboardController, humhub\modules\directory\components\Controller, humhub\modules\directory\controllers\DirectoryController, humhub\modules\file\controllers\FileController, humhub\modules\file\controllers\ViewController, humhub\modules\friendship\controllers\ListController, humhub\modules\friendship\controllers\ManageController, humhub\modules\friendship\controllers\RequestController, humhub\modules\installer\controllers\ConfigController, humhub\modules\installer\controllers\IndexController, humhub\modules\installer\controllers\SetupController, humhub\modules\ldap\controllers\AdminController, humhub\modules\like\controllers\LikeController, humhub\modules\live\controllers\PollController, humhub\modules\marketplace\controllers\BrowseController, humhub\modules\marketplace\controllers\LicenceController, humhub\modules\marketplace\controllers\PurchaseController, humhub\modules\marketplace\controllers\UpdateController, humhub\modules\notification\controllers\AdminController, humhub\modules\notification\controllers\EntryController, humhub\modules\notification\controllers\ListController, humhub\modules\notification\controllers\OverviewController, humhub\modules\notification\controllers\UserController, humhub\modules\post\controllers\PostController, humhub\modules\search\controllers\MentioningController, humhub\modules\search\controllers\SearchController, humhub\modules\space\controllers\BrowseController, humhub\modules\space\controllers\CreateController, 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\ContentTopicController, humhub\modules\topic\controllers\ManageController, humhub\modules\topic\controllers\TopicController, humhub\modules\tour\controllers\TourController, humhub\modules\user\components\BaseAccountController, humhub\modules\user\controllers\AccountController, humhub\modules\user\controllers\AuthController, humhub\modules\user\controllers\ImageController, humhub\modules\user\controllers\PasswordRecoveryController, humhub\modules\user\controllers\ProfileController, humhub\modules\user\controllers\RegistrationController, humhub\modules\web\pwa\controllers\ManifestController, humhub\modules\web\pwa\controllers\OfflineController, humhub\modules\web\pwa\controllers\ServiceWorkerController, humhub\modules\web\security\controllers\ReportController

Base Controller

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$actionTitlesMap array Page titles humhub\components\Controller
$pageTitle string Title of the rendered page humhub\components\Controller
$prependActionTitles boolean Append page title humhub\components\Controller
$subLayout null|string The name of the sub layout to be applied to this controller's views. humhub\components\Controller

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\components\Controller
behaviors() humhub\components\Controller
forcePostRequest() Throws HttpException in case the request is not an post request, otherwise returns true. humhub\components\Controller
getAccess() humhub\components\Controller
htmlRedirect() Create Redirect for AJAX Requests which output goes into HTML content. humhub\components\Controller
init() humhub\components\Controller
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
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

$access protected property

Defines the ControllerAccess class for this controller responsible for managing access rules

See also self::getAccess().

protected string $access = \humhub\components\access\ControllerAccess::class
$actionTitlesMap public property

Page titles

public array $actionTitlesMap = []
$pageTitle public property

Title of the rendered page

public string $pageTitle null
$prependActionTitles public property

Append page title

$subLayout public property

The name of the sub layout to be applied to this controller's views. This property mainly affects the behavior of \humhub\components\render().

public null|string $subLayout null

Method Details

appendPageTitle() public method

Append a page title.

public void appendPageTitle ( $title )
$title string
beforeAction() public method

See also \yii\web\Controller::beforeAction().

public void beforeAction ( $action )
$action
behaviors() public method

public void behaviors ( )
forbidden() protected method (available since version 1.2)

protected void forbidden ( )
throws \yii\web\ForbiddenHttpException
forcePostRequest() public method

Throws HttpException in case the request is not an post request, otherwise returns true.

public boolean forcePostRequest ( )
return boolean

Returns true in case the current request is a POST

throws \yii\web\HttpException
getAccess() public method

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

Returns an ControllerAccess instance

getAccessRules() protected method

Returns access rules for the standard access control behavior.

See also humhub\components\behaviors\AccessControl.

protected array getAccessRules ( )
return array

The access permissions

htmlRedirect() public method

Create Redirect for AJAX Requests which output goes into HTML content.

Is an alternative method to redirect, for ajax responses.

public void htmlRedirect ( $url "" )
$url
init() public method

public void init ( )
prependPageTitle() public method

Prepend a page title.

public void prependPageTitle ( $title )
$title string
redirect() public method

public void redirect ( $url, $statusCode 302 )
$url
$statusCode
renderAjaxContent() public method

public void renderAjaxContent ( $content )
$content
renderContent() public method (available since version 1.2)

Renders a static string by applying the layouts (sublayout + layout.

public string renderContent ( $content )
$content string

The static string being rendered

return string

The rendering result of the layout with the given static string as the $content variable. If the layout is disabled, the string will be returned back.

renderModalClose() public method

Closes a modal

public void renderModalClose ( )
setActionTitles() public method

Set a map that indicates what page title should be shown for the currently active action.

It will be appended to

public void setActionTitles ( $map = [], $prependActionTitles true )
$map array

[action_id => action_page_title]

$prependActionTitles boolean

Set to false if the action titles should rather be appended

setJsViewStatus() public method (available since version 1.2)

Sets some ui state as current controller/module and active topmenu.

This is required for some modules in pjax mode.

public void setJsViewStatus ( )
setPageTitle() public method

Set the page title.

public void setPageTitle ( $title )
$title string

Event Details

EVENT_INIT event of type \yii\base\Event

An event raised on init a controller.