WidgetBase
extends AbstractWidget
in package
Base Widget class.
Tags
Table of Contents
Properties
- $_content : string
- $_data : WidgetData
- $_description : string
- $_engine : TemplateEngine|null
- $_module : string
- $_name : string
- $_requires_cookies : bool
- $_settings : string|null
- $_smarty : Smarty|null
- Will be removed in 2.3.0.
- $_cache : Cache
Methods
- clearCache() : void
- Clear the cache for this widget, should be called when any settings of it are changed.
- display() : string
- Render this widget to be displayed on a template page. If this widget requires cookies and cookies are not allowed, a cookie notice is displayed instead.
- getDescription() : string
- Get the description of this widget.
- getLocation() : string
- Get the location (`left` or `right`) that this widget will be displayed on.
- getModule() : string
- Get the module of this widget.
- getName() : string
- Get the name of this widget.
- getOrder() : int
- Get the display order of this widget.
- getPages() : array<string|int, mixed>
- Get pages this widget is enabled on.
- getSettings() : string
- Get the path to the file for settings of this widget.
- getSmarty() : Smarty
- Get Smarty instance in use by this widget. Removed in 2.3.0.
- getTemplateEngine() : TemplateEngine
- Get template engine in use by this widget.
- initialise() : void
- Generate this widget's `$_content`.
- getData() : WidgetData
- Get widget data.
- cache() : Cache
Properties
$_content
protected
string
$_content
$_data
protected
WidgetData
$_data
$_description
protected
string
$_description
$_engine
protected
TemplateEngine|null
$_engine
$_module
protected
string
$_module
$_name
protected
string
$_name
$_requires_cookies
protected
bool
$_requires_cookies
= \false
$_settings
protected
string|null
$_settings
= \null
$_smarty
Will be removed in 2.3.0.
protected
Smarty|null
$_smarty
$_cache
private
Cache
$_cache
Methods
clearCache()
Clear the cache for this widget, should be called when any settings of it are changed.
public
final clearCache() : void
display()
Render this widget to be displayed on a template page. If this widget requires cookies and cookies are not allowed, a cookie notice is displayed instead.
public
display() : string
Returns an empty string if this widget is not to be displayed.
Tags
Return values
string —Content/HTML of this widget.
getDescription()
Get the description of this widget.
public
getDescription() : string
Return values
string —Description of widget.
getLocation()
Get the location (`left` or `right`) that this widget will be displayed on.
public
getLocation() : string
Return values
string —Location of widget.
getModule()
Get the module of this widget.
public
getModule() : string
Return values
string —Name of module.
getName()
Get the name of this widget.
public
getName() : string
Return values
string —Name of widget.
getOrder()
Get the display order of this widget.
public
getOrder() : int
Return values
int —Display order of widget.
getPages()
Get pages this widget is enabled on.
public
getPages() : array<string|int, mixed>
Return values
array<string|int, mixed> —Pages this widget is enabled on.
getSettings()
Get the path to the file for settings of this widget.
public
getSettings() : string
Return values
string —Widget settings URL.
getSmarty()
Get Smarty instance in use by this widget. Removed in 2.3.0.
public
getSmarty() : Smarty
Return values
Smarty —Instance in use.
getTemplateEngine()
Get template engine in use by this widget.
public
getTemplateEngine() : TemplateEngine
Return values
TemplateEngine —Engine in use.
initialise()
Generate this widget's `$_content`.
public
abstract initialise() : void
getData()
Get widget data.
protected
getData() : WidgetData
Will use cache if available, otherwise will query the database and store the result in cache.
Return values
WidgetData —Widget data.
cache()
private
cache() : Cache