Class humhub\modules\activity\components\ActivityWebRenderer

Inheritancehumhub\modules\activity\components\ActivityWebRenderer » humhub\components\rendering\LayoutRenderer » humhub\components\rendering\ViewPathRenderer » yii\base\BaseObject
Implementshumhub\components\rendering\Renderer
Available since version1.2

The ActivityWebRenderer is used to render BaseActivity instances for the Activity Stream.

A BaseActivity can overwrite the default view and layout by setting a specific $viewName and defining the following files:

Overwrite default view for this Activity:

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$defaultLayout string Default layout humhub\modules\activity\components\ActivityWebRenderer
$defaultViewPath string Default view path humhub\modules\activity\components\ActivityWebRenderer
$layout string Layout file path humhub\components\rendering\LayoutRenderer
$parent boolean If set to true the renderer will search in the parents view directory for the view. humhub\components\rendering\ViewPathRenderer
$subPath string A subpath within the view folder used for searching the view e. humhub\components\rendering\ViewPathRenderer
$viewPath string View path humhub\components\rendering\ViewPathRenderer

Public Methods

Hide inherited methods

MethodDescriptionDefined By
getLayout() Returns the layout for the given Notification Viewable. humhub\modules\activity\components\ActivityWebRenderer
getViewFile() Returns the view file for the given Viewable Notification. humhub\modules\activity\components\ActivityWebRenderer
getViewPath() Returns the directory containing the view files for this event. humhub\components\rendering\ViewPathRenderer
render() If a $layout is given the result will embed the rendered viewFile into the given $layout. humhub\modules\activity\components\ActivityWebRenderer
renderView() Helper function for rendering a Viewable with the given viewParams. humhub\components\rendering\ViewPathRenderer

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
suffix() Checks if the given $viewName has a file suffix or not. humhub\components\rendering\ViewPathRenderer

Property Details

$defaultLayout public property

Default layout

public string $defaultLayout '@activity/views/layouts/web.php'
$defaultViewPath public property

Default view path

public string $defaultViewPath '@activity/views'

Method Details

getLayout() public method

Returns the layout for the given Notification Viewable.

This function will search for a layout file under @module/views/layouts/mail with the view name defined by $viewable.

If this file does not exists the default layout will be returned.

public \humhub\modules\activity\components\type getLayout ( humhub\components\rendering\Viewable $viewable )
$viewable \humhub\modules\notification\components\Viewable
getViewFile() public method

Returns the view file for the given Viewable Notification.

This function will search for the view file defined in the Viewable within the module/views/mail directory of the viewable module.

If the module view does not exist we search for the viewName within the default notification viewPath.

If this view also does not exist we return the base notification view file.

public string getViewFile ( humhub\components\rendering\Viewable $viewable )
$viewable \humhub\modules\notification\components\Viewable
return string

View file of this notification

render() public method

If a $layout is given the result will embed the rendered viewFile into the given $layout.

public string render ( humhub\components\rendering\Viewable $viewable, $params = [] )
$viewable humhub\components\rendering\Viewable
$params \humhub\components\rendering\type