manager/controllers/default/dashboard/widget.modx-news.php
- Package
- modx
- Subpackage
- dashboard
\modDashboardWidgetNewsFeed
Abstract class used for creating Dashboard Widgets. In your widget file, simply return the name of the class at the end of the file, and MODX will instantiate your class as a widget, and run the render() method to get the widget output.
- Parent(s)
- \modDashboardWidgetInterface
Properties
string
$content= ''''
''
Details- Type
- string
- Inherited_from
- \modDashboardWidgetInterface::$$content
\modManagerController
$controller= ''
A reference to the currently loaded manager controller
Inherited from: \modDashboardWidgetInterface::$$controller- Type
- \modManagerController
- Inherited_from
- \modDashboardWidgetInterface::$$controller
string
$cssBlockClass= ''''
Allows widgets to specify a CSS class to attach to the block
Inherited from: \modDashboardWidgetInterface::$$cssBlockClass''
Details- Type
- string
- Inherited_from
- \modDashboardWidgetInterface::$$cssBlockClass
\xPDO|\modX
$modx= ''
- Type
- \xPDO | \modX
- Inherited_from
- \modDashboardWidgetInterface::$$modx
\modNamespace
$namespace= ''
A reference to the Namespace that this widget is executing in
Inherited from: \modDashboardWidgetInterface::$$namespace- Type
- \modNamespace
- Inherited_from
- \modDashboardWidgetInterface::$$namespace
\modDashboardWidget
$widget= ''
- Type
- \modDashboardWidget
- Inherited_from
- \modDashboardWidgetInterface::$$widget
Methods
__construct(
\xPDO | \modX $modx, \modDashboardWidget $widget, \modManagerController $controller
)
:
void
Name | Type | Description |
---|---|---|
$modx | \xPDO | \modX | A reference to the modX instance |
$widget | \modDashboardWidget | A reference to this class's widget |
$controller | \modManagerController | A reference to the currently loaded manager controller |
getFileChunk(
string $tpl, array $placeholders
=
array()
)
:
string
Name | Type | Description |
---|---|---|
$tpl | string | |
$placeholders | array |
Type | Description |
---|---|
string |
process(
)
:
string
Renders the content of the block in the appropriate size
Inherited from: \modDashboardWidgetInterface::process()Type | Description |
---|---|
string |
render(
)
:
string
Must be declared in your derivative class. Must return the processed output of the widget.
Type | Description |
---|---|
string |
renderAsSnippet(
string $content
=
''
)
:
string
Render the widget content as if it were a Snippet
Inherited from: \modDashboardWidgetInterface::renderAsSnippet()Name | Type | Description |
---|---|---|
$content | string |
Type | Description |
---|---|
string |
setNamespace(
\modNamespace $namespace
)
:
void
Sets the Namespace that this widget will execute in
Inherited from: \modDashboardWidgetInterface::setNamespace()Name | Type | Description |
---|---|---|
$namespace | \modNamespace |
toArray(
)
:
array
Returns an array of placeholders for the block from the widget class. Override to add or change placeholders.
Inherited from: \modDashboardWidgetInterface::toArray()Type | Description |
---|---|
array |