ToggleHelper
extends Helper
in package
This is a helper class is used to draw an On-Off switch in a web page
Tags
Table of Contents
- __construct() : mixed
- The constructor at this point does nothing
- render() : mixed
- Draws an On Off switch in HTML where to toggle state one clicks a link
Methods
__construct()
The constructor at this point does nothing
public
__construct() : mixed
Return values
mixed —render()
Draws an On Off switch in HTML where to toggle state one clicks a link
public
render(bool $state, string $on_url, string $off_url[, bool $caution = false ]) : mixed
Parameters
- $state : bool
-
whether the switch is on or off
- $on_url : string
-
url that is sent when one clicks on
- $off_url : string
-
url that is sent when one clicks off
- $caution : bool = false
-
is set to true if on in the database but the status received from testing the state of the toggle some other way is off (causes things to draw in yellow rather than green)