Checkbox
Checkbox element for boolean items.
Read View | Edit View |
---|---|
Constructor
/**
* @param $id
* @param string $label - the label of the element
* @param array $permissions - View, edit, read rights of the elemenet.
See WpooWPermissions in the Overview section.
*
**/
function __construct($id, $label, $permissions=[])
Usage example
// Declaring
$bookAvailableCheckbox = new Checkbox("_isbookAvailable", "Book Available")
$bookReviewPostType->AddField($bookAvailableCheckbox);
// Fetching Data
foreach ($bookReviewPostType->Query()->Select()->Fetch() as $row)
{
if ($row["_isbookAvailable"] == "on")
{
//Do something.
}
}