Skip to content

icms_form_elements_Radioyn

Raimondas Rimkevičius edited this page Mar 9, 2020 · 1 revision
Notice: Wiki was automatic generated from project sources as project API documentation. Do not edit manually!

icms_form_elements_Radioyn

Yes/No radio buttons.

A pair of radio buttons labeled _YES and _NO with values 1 and 0

Properties

$_options

private array $_options = array()

Array of Options

  • Visibility: private

$_value

private string $_value = \null

Pre-selected value

  • Visibility: private

$_delimeter

private string $_delimeter

HTML to separate the elements

  • Visibility: private

Methods

__construct

mixed icms_form_elements_Radio::__construct(string caption, string name, string value, mixed delimeter)

Constructor

Arguments

  • caption string - <p>Caption</p>
  • name string - <p>"name" attribute</p>
  • value string - <p>Pre-selected value</p>
  • delimeter mixed

getValue

string icms_form_elements_Radio::getValue(bool encode)

Get the "value" attribute

Arguments

  • encode bool - <p>To sanitizer the text?</p>

setValue

mixed icms_form_elements_Radio::setValue(value)

Set the pre-selected value

Arguments

  • value mixed - <p>string</p>

addOption

mixed icms_form_elements_Radio::addOption(string value, string name)

Add an option

Arguments

  • value string - <p>"value" attribute - This gets submitted as form-data.</p>
  • name string - <p>"name" attribute - This is displayed. If empty, we use the "value" instead.</p>

addOptionArray

mixed icms_form_elements_Radio::addOptionArray(array options)

Adds multiple options

Arguments

  • options array - <p>Associative array of value->name pairs.</p>

getOptions

array icms_form_elements_Radio::getOptions(int encode)

Get an array with all the options

Arguments

  • encode int - <p>To sanitizer the text? potential values: 0 - skip; 1 - only for value; 2 - for both value and name</p>

getDelimeter

string icms_form_elements_Radio::getDelimeter(bool encode)

Get the delimiter of this group

Arguments

  • encode bool - <p>To sanitizer the text?</p>

render

string icms_form_elements_Radio::render()

Prepare HTML for output

Clone this wiki locally