class \mpf\web\helpers\Form

class \mpf\web\helpers\Form

-no description found-

Attributes
public null $tinyMCESkin = "lightgray"

MarkItUp http://markitup.jaysalvat.com/ is used to generate HtmlTextareas by method ::htmlTextarea. From this variable JS file for settings can be changed to a custom one.

public string $markdownHint = "This input uses Markdown syntax. Click For Details"

-no description found-

public array $tinyMCEOptionTemplates = {"basic":{"plugins":["advlist autolink lists link image charmap print preview anchor","searchreplace visualblocks code fullscreen","insertdatetime media table contextmenu paste"],"menubar":false},"advanced":{"plugins":["advlist autolink lists link image charmap print preview anchor","searchreplace visualblocks code fullscreen","insertdatetime media table contextmenu paste"],"toolbar":"insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"},"full":{"theme":"modern","plugins":["advlist autolink lists link image charmap print preview hr anchor pagebreak","searchreplace wordcount visualblocks visualchars code fullscreen","insertdatetime media nonbreaking save table contextmenu directionality","emoticons template paste textcolor colorpicker textpattern"],"toolbar1":"insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image","toolbar2":"print preview media | forecolor backcolor emoticons","image_advtab":true}}

-no description found-

private mixed $_date_input_count

-no description found-

Methods

public string input (string $name, string $type = "text", string $value = null, array $htmlOptions = [])

  • $name

    -no description found-

  • $type

    -no description found-

  • $value

    -no description found-

  • $htmlOptions

    -no description found-

Generates an input with the selected data. Value is automatically calculated if it's sent as null. For this, it will check $POST and $GET for keys with same name as input.

public string hiddenInput (string $name, string $value = null, array $htmlOptions = [])

  • $name

    -no description found-

  • $value

    -no description found-

  • $htmlOptions

    -no description found-

Generates a hidden input field with the specified name, value and htmlOptions.

public string openForm (string $htmlOptions)

  • $htmlOptions

    -no description found-

Returns an open form tag with the selected html options;

public string closeForm ()

Returns a close form tag;

public string htmlTextarea (mixed $name, null $value = null, array $htmlOptions = [], string $tinyMCETemplate = "basic")

  • $name

    -no description found-

  • $value

    -no description found-

  • $htmlOptions

    -no description found-

  • $tinyMCETemplate

    -no description found-

Generates an HTML Textarea using TinyMCE

public mixed textarea (mixed $name, mixed $value = null, mixed $htmlOptions = [])

  • $name

    -no description found-

  • $value

    -no description found-

  • $htmlOptions

    -no description found-

-no description found-

public mixed select (mixed $name, mixed $options, mixed $value = null, mixed $htmlOptions = [], mixed $emptyValue = false)

  • $name

    -no description found-

  • $options

    -no description found-

  • $value

    -no description found-

  • $htmlOptions

    -no description found-

  • $emptyValue

    -no description found-

-no description found-

protected null getArrayValue (string $source, string $name)

  • $source

    -no description found-

  • $name

    -no description found-

Get value from array. It will parse the name and search for [ or ] to read the real value.

public mixed checkbox (string $name, string $label, int $value = 1, null $checked = null, array $htmlOptions = [], string $template = ")

  • $name

    -no description found-

  • $label

    -no description found-

  • $value

    -no description found-

  • $checked

    -no description found-

  • $htmlOptions

    -no description found-

  • $template

    -no description found-

-no description found-

public mixed radio (string $name, string $label, int $value = 1, null $checked = null, array $htmlOptions = [], string $template = ")

  • $name

    -no description found-

  • $label

    -no description found-

  • $value

    -no description found-

  • $checked

    -no description found-

  • $htmlOptions

    -no description found-

  • $template

    -no description found-

-no description found-

public string checkboxGroup (string $name, array $options, null $selected = null, array $htmlOptions = [], string $template = ", string $separator = "
"
)

  • $name

    -no description found-

  • $options

    -no description found-

  • $selected

    -no description found-

  • $htmlOptions

    -no description found-

  • $template

    -no description found-

  • $separator

    -no description found-

Generate a group of checkbox inputs

public string radioGroup (mixed $name, mixed $options, null $selected = null, array $htmlOptions = [], string $template = ", string $separator = "
"
)

  • $name

    -no description found-

  • $options

    -no description found-

  • $selected

    -no description found-

  • $htmlOptions

    -no description found-

  • $template

    -no description found-

  • $separator

    -no description found-

-no description found-

public string markdown (mixed $name, null $value = null, array $htmlOptions = [], bool $showHint = true, bool $showPreview = true, null $previewURL = null)

  • $name

    -no description found-

  • $value

    -no description found-

  • $htmlOptions

    -no description found-

  • $showHint

    -no description found-

  • $showPreview

    -no description found-

  • $previewURL

    -no description found-

-no description found-

public string date (string $name, string $value = null, string $format = "yy-mm-dd", array $htmlOptions = [])

  • $name

    -no description found-

  • $value

    -no description found-

  • $format

    -no description found-

  • $htmlOptions

    -no description found-

Get HTML input with jQuery UI date.

public string submitButton (string $value, string $name = "", array $htmlOptions = [])

  • $value

    Value in this case will be used to display a text on the button. It will also be sent when form is submitted if a name is specified.

  • $name

    Optional button name

  • $htmlOptions

    Optional extra button html options

Generates a submit button for current form.

public string imageButton (string $src, string $alt = "Submit", string $name = "", string $value = "", array $htmlOptions = [])

  • $src

    Image URL

  • $alt

    Text to be displayed in case that image is not loaded

  • $name

    Optional a name can be added

  • $value

    Optional a value can also be added

  • $htmlOptions

    Extra HTML options. Values for scr, alt, type, name, value will be replaced with first parameters of this method

Creates a button from a image. Button can be used to submit/cancel or anything else is added.