Quick and easy form builder
This is the code documentation for the SproutCMS project
Search documentation |
class FbQuick and easy form builder
Extending this class<?php
/**
* New class description goes here
*
* @author Your Name, 2026-09-15
**/
class NewClassName extends Fb {
/**
* Render map location selector
* Zoom field is optional
**/
public function googleMap (string $name, array $attrs, array $params) {
// Method code goes here
}
/**
* A conditions list, which is an interface for building rules for
* use in dynamic IF-statement style systems.
*
* Output POST data will be a JSON string of the condition rules,
* as an array of objects with the keys 'field', 'op', 'val' for
* each condition.
*
* There are two parameters:
* fields array Available field types, name => label
* url string AJAX lookup method which returns the
* operator and value lists
*
* The lookup url is provided GET params 'field', 'op', 'val' and
* should output JSON with two keys, 'op' and 'val', which are both
* strings containing HTML for the fields; the op field should be
* a SELECT and the val field should be an INPUT or a SELECT.
**/
public function conditionsList (string $name, array $attrs, array $params) {
// Method code goes here
}
/**
* Renders google autocomplete address fields
**/
public function autoCompleteAddress (string $name, array $attrs, array $options) {
// Method code goes here
}
/**
* Renders place name geocoding fields
**/
public function geocodeAddress (string $name, array $attrs, array $options) {
// Method code goes here
}
/**
* Render a 'generate code' button + text field
**/
public function randomCode (mixed $name, array $attrs, array $options) {
// Method code goes here
}
/**
* UI for selecting or drag-and-drop uploading one or more files.
*
* The field (refrenced by $name) is an array. If it's passed a a string, it will be comma-separated into an array.
* As JsonForm will auto-convert arrays into comma-separated strings, this field can easily be used with a MySQL
* field of type TEXT.
*
* You cannot have more than one of these on the page at a time
*
* This field WILL NOT operate in a non-admin environment
**/
public function multipleFileSelect (string $name, array $attrs, array $options) {
// Method code goes here
}
/**
* Generates the title for a field, possibly enclosing it in a label, possibly with a generated ID
**/
public function title (string $title, string|null $id) {
// Method code goes here
}
/**
* Renders a set of hidden fields
**/
public function hiddenFields (array $fields) {
// Method code goes here
}
/**
* Renders a timepicker field inside a SPAN, which displays a dropdown date selection box when clicked
**/
public function timepicker (string $name, array $attrs, array $params) {
// Method code goes here
}
/**
* Renders HTML containing a date-time selection UI. Output field value is in YYYY-MM-DD HH:MM:SS
**/
public function datetimepicker (string $name, array $attrs, array $options) {
// Method code goes here
}
/**
* Renders HTML containing a total selector UI. Output field value for the total is in
* a hidden field. The specific counts for each are also available
**/
public function totalselector (string $name, array $attrs, array $options) {
// Method code goes here
}
/**
* Renders a colour picker
*
* Uses the HTML5 'color' input type, and loads a JS fallback (spectrum)
* http://bgrins.github.io/spectrum/
* Note that spectrum requires jQuery 1.6 or later
**/
public function colorpicker (string $name, array $attrs, array $params) {
// Method code goes here
}
/**
* Renders a datetime range picker
*
* Output is in the form of two fields (given in name as a comma separated list) e.g.
* $name = 'date_start,date_end' will result in two fields:
* date_start => YYYY-MM-DD HH:MM:SS, date_end => YYYY-MM-DD HH:MM:SS
**/
public function datetimerangepicker (string $name, array $attrs, array $options) {
// Method code goes here
}
/**
* Generates a dropdown selection menu from a Treenode and its children
**/
public function dropdownTree (string $name, array $attrs, array $options) {
// Method code goes here
}
/**
* Used internally for recursive dropdown generation.
**/
private function dropdownTreeItem (Pagenode $node, int $depth, int $selected, array $exclude) {
// Method code goes here
}
/**
* Renders HTML containing a date selection UI. Output field value is in YYYY-MM-DD
**/
public function datepicker (string $name, array $attrs, array $options) {
// Method code goes here
}
/**
* Renders a date range picker. Output is in the form of two fields (given in name as a comma separated list) e.g.
* name => date_start, date_end will result in two fields: date_start => YYYY-MM-DD, date_end => YYYY-MM-DD
**/
public function daterangepicker (string $name, array $attrs, array $options) {
// Method code goes here
}
/**
* Renders simplified date range picker,
* Output is in the form of two fields (given in name as a comma separated list) e.g.
* name => date_start, date_end will result in two fields: date_start => YYYY-MM-DD, date_end => YYYY-MM-DD
**/
public function simpledaterangepicker (string $name, array $attrs, array $options) {
// Method code goes here
}
/**
* Generates a page dropdown selection menu
*
* Just a wrapper for {@see Fb::dropdownTree}
**/
public function pageDropdown (string $name, array $attrs, array $options) {
// Method code goes here
}
/**
* Returns HTML containing multiple boolean checkboxes
**/
public function checkboxBoolList (string $name, array $attrs, array $settings) {
// Method code goes here
}
/**
* Returns HTML containing multiple checkboxes, with values to store in a SET column or similar
**/
public function checkboxSet (string $name, array $attrs, array $settings) {
// Method code goes here
}
/**
* Returns the HTML for a single checkbox
**/
protected function checkbox (string $name, string $label, int|string $value, bool $selected, array $attrs) {
// Method code goes here
}
/**
* Generates a HTML5 range field
**/
public function range (string $name, array $attrs, array $options) {
// Method code goes here
}
/**
* Generates a password field
**/
public function password (string $name, array $attrs) {
// Method code goes here
}
/**
* Generates a file upload field
**/
public function upload (string $name, array $attrs) {
// Method code goes here
}
/**
* Generates a file upload field with a progress bar
*
* To easily save the uploaded files in the form action function, see {@see File::replaceSet}
**/
public function chunkedUpload (string $name, array $attrs, array $params) {
// Method code goes here
}
/**
* Renders a HTML5 email field
**/
public function email (string $name, array $attrs, array $options) {
// Method code goes here
}
/**
* Renders a HTML5 phone number field (type=tel)
**/
public function phone (string $name, array $attrs, array $params) {
// Method code goes here
}
/**
* Render the UI for our multi-type link fields
**/
public function lnk (string $name, array $attrs, array $options) {
// Method code goes here
}
/**
* A file selection field, for use in the admin only.
**/
public function fileSelector (string $name, array $attrs, array $options) {
// Method code goes here
}
/**
* Generates a richtext field - i.e. TinyMCE
**/
public function richtext (string $name, array $attrs, array $items) {
// Method code goes here
}
/**
* Generates a multiline text field
**/
public function multiline (string $name, array $attrs) {
// Method code goes here
}
/**
* Generates a dropdown selection menu
**/
public function dropdown (string $name, array $attrs, array $options) {
// Method code goes here
}
/**
* Returns HTML for a list of OPTIONs, and depending on the input array, OPTGROUP tags.
**/
public function dropdownItems (array $options, string|array $selected) {
// Method code goes here
}
/**
* Returns HTML for an autocomplete selection menu.
* Expects to be provided AJAX data in a format defined by jQuery UI (see 'url' option below).
* By default, this expects to stores an ID value for a foreign key. If this isn't the desired
* behaviour, a plain text value can be stored by setting the 'save_id' option to false.
*
* The URL which handles the lookups needs to use the 'term' GET param to find matching values.
* If 'save_id' is true, then it also needs to accept the 'id' GET param to fetch the label for the relevant id.
* A call to the URL should return JSON which contains an array of hashes, each with the following keys:
* - 'value': data for the text input.
* - 'label': data for display in the drop-down list (if different from value).
* This is used as the value if 'value' isn't specified.
* - 'id': id value to save. This should only be specified if 'save_id' is true; see below.
**/
public function autocomplete (string $name, array $attrs, array $options) {
// Method code goes here
}
/**
* Returns HTML for a bunch of radiobuttons
**/
public function multiradio (string $name, array $attrs, array $options) {
// Method code goes here
}
/**
* Render autocomplete multi-list
**/
public function autocompleteList (string $name, array $attrs, array $options) {
// Method code goes here
}
/**
* Shows a HTML5 number field
**/
public function number (string $name, array $attrs) {
// Method code goes here
}
/**
* Shows a HTML5 number field, formatted for dollar prices
**/
public function money (string $name, array $attrs, array $options) {
// Method code goes here
}
/**
* Outputs the value of the field directly, in a span
**/
public function output ($name, array $attrs) {
// Method code goes here
}
/**
* Generates a text field
**/
public function text (string $name, array $attrs) {
// Method code goes here
}
/**
* Generates an HTML INPUT tag using {@see Fb::tag}, with auto-determined value
**/
public function input (string $type, string $name, array $attrs) {
// Method code goes here
}
/**
* Generates an HTML opening tag, and possibly its closing tag, depending on the params specified
*
* You can specify either HTML or plain-text content, but not both
**/
public function tag (string $name, array $attrs, array $params) {
// Method code goes here
}
/**
* Adds an HTML attribute to the list of attributes.
* If the attribute has already been set, it will be left alone.
* N.B. the 'class' attribute is always appended
**/
protected function addAttr (array $attrs, string $name, string $value) {
// Method code goes here
}
/**
* Generate a unique id
**/
private function genId () {
// Method code goes here
}
/**
* Injects the current auto-generated id into an array of attributes.
* Only applies if an auto-generated id exists and an id isn't already set in the attributes.
* The auto-generated id is then cleared.
**/
protected function injectId (array $attrs) {
// Method code goes here
}
/**
* Gets the data for a single field from the data array
*
* Properly handles PHP sub-arrays (e.g. 'options[food]'), doesn't handle
* anon arrays though (e.g. 'options[]').
**/
public function getData (string $name) {
// Method code goes here
}
/**
* Generates a heading using a H3 tag
**/
public function heading (string $heading) {
// Method code goes here
}
/**
* Sets the data that is used for form-building
* This is typically from a database row or saved session data
* To set a single field, instead use {@see Fb::setFieldValue}
**/
public function setData (array $data) {
// Method code goes here
}
/**
* Sets the value for a single field
* This is the non-array version of {@see Fb::setData}
**/
public function setFieldValue (array $field, array $value) {
// Method code goes here
}
/**
* Sets the text for the top item of dropdown lists.
* Set to an empty string to not show the top item.
* This will be reset to the default value after every call to {@see Fb::dropdown}
**/
public function setDropdownTop (string $label) {
// Method code goes here
}
}
?>
|
| Powered by Pelzini, version 0.9.0 |
Documentation is made available under the
GNU Free Documentation License 1.2. Generated: Tuesday, 15th September, 2026 at 10:26 am |
|