AbstractWidget extends Html
Abstract Widget
Attributes
- #[AllowDynamicProperties]
Table of Contents
Properties
| $ajax_filtering | |
| $eol | |
| $filter_html | |
| $filter_uri | |
| $filters | |
| $header_link | |
| $link_buttons | |
| $nav | |
| $nav_type | |
| $render | |
| $return_output | |
| $show_filters | |
| $style_sheets | |
| $widget_buttons |
Methods
| setAjaxFiltering() | Sets whether to submit filters and reload widget via ajax |
| setFilterHtml() | Sets HTML for the widget filtering form |
| setFilters() | Sets a list of widget filters |
| setHeaderLink() | Sets the link for the widget header |
| setLinkButtons() | Sets navigation buttons along with AbstractWidget::setLinks(). This method may only be used in addition with AbstractWidget::setLinks() |
| setLinks() | Sets navigation links within the widget |
| setOutput() | Set whether to return $output generated by these methods, or to echo it out instead |
| setStyleSheet() | Sets a style sheet to be linked into the document |
| setWidgetButton() | Set a widget button to be displayed in the title bar of the widget |
| output() | Handles whether to output or return $html |
| setFilterLink() | Add the filter form toggle button to the list of widget links |
Properties
$ajax_filtering
protected
bool
$ajax_filtering
Whether to submit filters and reload widget via ajax
$eol
protected
string
$eol
= "\n"
The string to use as the end of line character, "\n" by default
$filter_html
protected
string
$filter_html
= ''
The HTML to display either in or as the widget filtering form
$filter_uri
protected
string
$filter_uri
= ''
The uri to which the widget filtering form should be submitted
$filters
protected
InputFilters
$filters
A list of input fields to display in the widget filtering form
$header_link
protected
string
$header_link
= ''
The widget header link
$link_buttons
protected
array<string|int, mixed>
$link_buttons
= []
An array of link buttons
$nav
protected
array<string|int, mixed>
$nav
= []
An array of navigation elements
$nav_type
protected
string
$nav_type
= 'links'
Sets the navigation type:
- links
- tabs
- pills
$render
protected
string
$render
How to render the widget. Options include:
- full The entire widget (default)
- inner The content only (everything excluding the nav and title)
- content_section The full content including nav (everything exluding box frame and title section)
- common_box_content The content only (full_content excluding the nav)
$return_output
protected
bool
$return_output
= false
Whether or not to return output from various widget methods
$show_filters
protected
bool
$show_filters
Whether to show the filter content on page load
$style_sheets
protected
array<string|int, mixed>
$style_sheets
= []
An array of style sheet attributes to be rendered into the DOM
$widget_buttons
protected
array<string|int, mixed>
$widget_buttons
= []
Buttons that should be displayed within the window
Methods
setAjaxFiltering()
Sets whether to submit filters and reload widget via ajax
public
setAjaxFiltering([bool $ajax = true ]) : mixed
Parameters
- $ajax : bool = true
-
Whether to submit filters and reload widget via ajax
setFilterHtml()
Sets HTML for the widget filtering form
public
setFilterHtml(string $html[, bool $show_filters = false ]) : mixed
Parameters
- $html : string
-
The uri for the widget filtering form action
- $show_filters : bool = false
-
Whether to show the filtering form on page load
setFilters()
Sets a list of widget filters
public
setFilters(InputFields $filters, string $uri[, bool $show_filters = false ]) : mixed
Parameters
- $filters : InputFields
-
A list of input fields to display in the widget filtering form
- $uri : string
-
The uri for the widget filtering form action
- $show_filters : bool = false
-
Whether to show the filtering form on page load
setHeaderLink()
Sets the link for the widget header
public
setHeaderLink(string $link) : mixed
Parameters
- $link : string
-
The link for the widget header
setLinkButtons()
Sets navigation buttons along with AbstractWidget::setLinks(). This method may only be used in addition with AbstractWidget::setLinks()
public
setLinkButtons(array<string|int, mixed> $link_buttons) : mixed
Parameters
- $link_buttons : array<string|int, mixed>
-
A multi-dimensional array of button links including:
- name The name of the button link to be displayed
- icon The class name of the icon to display before the name
- attributes An array of attributes to set for this button link (e.g. array('href'=>"#"))
setLinks()
Sets navigation links within the widget
public
setLinks(array<string|int, mixed> $link[, string $type = 'links' ]) : mixed
Parameters
- $link : array<string|int, mixed>
-
A multi-dimensional array of tab info including:
- name The name of the link to be displayed
- current True if this element is currently active
- attributes An array of attributes to set for this link (e.g. array('href'=>"#"))
- $type : string = 'links'
-
the type of links being set (optional) (links or tabs, default links)
setOutput()
Set whether to return $output generated by these methods, or to echo it out instead
public
setOutput(bool $return) : mixed
Parameters
- $return : bool
-
True to return output from these widget methods, false to echo results instead
setStyleSheet()
Sets a style sheet to be linked into the document
public
setStyleSheet(string $path[, array<string|int, mixed> $attributes = null ]) : mixed
Parameters
- $path : string
-
the web path to the style sheet
- $attributes : array<string|int, mixed> = null
setWidgetButton()
Set a widget button to be displayed in the title bar of the widget
public
setWidgetButton(string|array<string|int, mixed> $button) : mixed
Parameters
- $button : string|array<string|int, mixed>
-
The widget button attributes
output()
Handles whether to output or return $html
protected
output(string $html) : string
Parameters
- $html : string
-
The HTML to output/return
Return values
string —The HTML given, void if output enabled
setFilterLink()
Add the filter form toggle button to the list of widget links
protected
setFilterLink() : mixed