$include_ns
$include_ns : string
The Nano namespace where we'll load component views from.
Generate common HTML structures.
select(mixed $attrs, array $array, array $opts = array())
Generate an HTML Select structure.
Generates a structure containing elements for each item in an associative array, where the array key is the HTML value, and the array value is the option label.
| mixed | $attrs | HTML attributes for the select tag. |
| array | $array | Array of Options, where $value => $label. |
| array | $opts | Optional function-specific settings, see below. The $attrs can either be an associative array of HTML attributes for the select tag, or can be the value of the 'name' attribute. The $opts array may contain several options on top of the standard output options: 'selected' => mixed The current selected value. 'mask' => boolean If true, selected value is a bitmask. 'id' => boolean If true, and no 'id' attrib exists, we set the 'id' for the select to be the same as the 'name' attribute. 'ns' => string Translation prefix. This is only valid if the HTML object has a 'translate' object set. 'ttns' => string Tooltip translation prefix. If you set this, and the HTML object has a 'translate' object, tooltips can be added to your options. |
ul(array $menu, array $opts = array())
Generate a recursive list (<ul/>).
Creates a
| array | $menu | The array representing the menu. |
| array | $opts | Optional function-specific settings. In addition to the usual output options, this also supports the following option: 'type' => string The list type, defaults to 'ul'. The array representing the menu can be quite complex. Flat members (i.e. ones where you did not specify the key) that are strings are considered text items for the list. Flat members that are arrays are considered attributes. If no other list item has been defined yet, the attributes will be applied to the top-level list element, otherwise they will be applied to the last defined list item. Named members (i.e. ones where you specify a named key) that have array values are considered sub-menus, and the same rules apply to that array as this one. Named members with string values will set the 'class' attribute on the list item to the value of the string. |
strip(String $text, Array $filters = array('R', 'E'))
Extract plain text from HTML.
| String | $text | The input HTML text. |
| Array | $filters | An array of strip filters to apply, in order. Default: ['R','E'] Filters: 'T' Pass through strip_tags() 'E' Pass through htmlspecialchars_decode() 'EE' Pass through html_entity_decode() 'R' Use a custom regex to strip HTML tags (including ) 'RR' Extend the regex to strip even more. Any of the multiple letter tags are higher level extensions of the single letter version, and thus you shouldn't ever have more than one in an array, so ['E','EE'] or ['R','RR'] are redundant. |
return_value(mixed $value, array $opts)
Protected function that handles return values.
We previously supported a bunch of different output formats. Now we offer two. The default is to return the HTML string. If you pass 'raw' => true to the opts, we will return the raw object. Also, if the value passed is not a SimpleXML element, we will return it as if 'raw' had been passed.
| mixed | $value | A SimpleXML object, or a string. |
| array | $opts | Options controlling the output. |