Documentation

HtmlDropdown extends TiqBase
in package

Class that can create an html dropdown for choice/value selection

Requires two arrays of the same length, choices which show up in the dropdown and values which correspond to the choices for use in code

To use, create an instance of the class with the two arrays and echo $theClass->dropDownHTML at the end of your phpgrid. To use the values get them from * the public class variables

Table of Contents

$array_min  : mixed
$choices  : mixed
$message  : mixed
$selectedChoice  : mixed
$selectedValue  : mixed
$values  : mixed
$html_name  : mixed
$show_run_button  : mixed
__construct()  : mixed
This will not create a dropdown. Outputting the result of dropDownHTML will
__get()  : mixed
Base getter hooked into php's magic __get
__set()  : mixed
Base setter hooked into php's magic __set
dropDownHTML()  : mixed
echo's out the html to create a dropdown give a list of choices
terminate()  : mixed
Logs an error and throws and exception
getValue()  : mixed
gets the data out of the POST variable, also preserves the users selection
lengthMin()  : int
Find min array length out of a set of arrays

Properties

Methods

__construct()

This will not create a dropdown. Outputting the result of dropDownHTML will

public __construct(array<string|int, mixed> $choices, array<string|int, mixed> $values[, string $message = 'Select: ' ][, mixed $html_name = 'selected_value' ][, mixed $show_run_button = false ]) : mixed
Parameters
$choices : array<string|int, mixed>

List of choices seen in the dropdown

$values : array<string|int, mixed>

Values corresponding to the choices

$message : string = 'Select: '

The text that will appear next to the dropdown

$html_name : mixed = 'selected_value'
$show_run_button : mixed = false
Return values
mixed

__get()

Base getter hooked into php's magic __get

public __get(string $name) : mixed

Allows the retrieval of properties from a class. Requires the implementation of a get method in the concrete class

Parameters
$name : string

name of the property

Return values
mixed

__set()

Base setter hooked into php's magic __set

public __set(string $name, mixed $value) : mixed

Allows the settings of properties on a class safely. Requires the implementation of a set method in the concrete class

Parameters
$name : string

name of property to be set

$value : mixed
Return values
mixed

dropDownHTML()

echo's out the html to create a dropdown give a list of choices

public dropDownHTML() : mixed
Return values
mixed

terminate()

Logs an error and throws and exception

protected terminate([string $message = '' ]) : mixed
Parameters
$message : string = ''

Reason for termination

Tags
throws
LogicException
Return values
mixed

getValue()

gets the data out of the POST variable, also preserves the users selection

private getValue() : mixed
Return values
mixed

lengthMin()

Find min array length out of a set of arrays

private lengthMin(mixed $arrays) : int
Parameters
$arrays : mixed
Return values
int

Search results