html() html()

The widget helper: html()->tabs(), ->modal(), ->select_box()... return HTML strings in the markup of the current css framework.

html()->chained_wrapper($params = [])

Options

OptionMeaning
$paramsKept for the chain; html() returns the shared yf_html object.

Example

Hello

html() widgets return strings.
Every widget follows conf('css_framework'): Bootstrap 3 markup, or Bootstrap 5 from yf_html_bs5.

Code

return html()->alert(['alert' => 'info', 'head' => 'Hello', 'body' => 'html() widgets return strings.'])
    . html()->well('Every widget follows conf(\'css_framework\'): Bootstrap 3 markup, or Bootstrap 5 from yf_html_bs5.');

Notes

  • html() is _class('html')->chained_wrapper($params); _class('html')->tabs(...) is the same call.
  • Texts the widgets call text (titles, labels, the text of badges and buttons) are escaped; bodies (body, tab contents, modal parts) are developer HTML: escape request data in them and run it through _escape_tpl_braces(), the page template parses the output again.
  • Each widget gives itself an id <widget>_<n> per page unless you pass id.
  • Under css_framework = bs5 the 24 classic widgets render native Bootstrap 5.3 markup (yf_html_bs5); B5 options are active only when passed, so existing calls keep their output.

Bootstrap 3 and 5

Bootstrap 3 is the default until 4.0; switch per site with $CONF['css_framework'] = 'bs5'. These pages follow the switcher in the navbar.

See also: html/complex_test, demo:html/bs5_components, demo:html/bs5_options