skipv1_0_0get_select
Select getter Function.
Description
skip\v1_0_0\get_select( (string) $name, $elements, (constant) $label = FALSE, (array) $args = array(), (string) $return = 'html' );
Parameters (5)
- 0. $name (string)
- The name.
- 1. $elements
- The elements.
- 2. $label — Optional. (constant) =>
FALSE
- The label.
- 3. $args — Optional. (array) =>
array()
- The args.
- 4. $return — Optional. (string) =>
'html'
- The return.
Usage
if ( !function_exists( 'skip\v1_0_0\get_select' ) ) { require_once '/includes/skip/elements/forms/select.php'; } // The name. $name = ''; // The elements. $elements = null; // The label. $label = FALSE; // The args. $args = array(); // The return. $return = 'html'; // NOTICE! Understand what this does before running. $result = skip\v1_0_0\get_select($name, $elements, $label, $args, $return);
Defined (1)
The function is defined in the following location(s).
- /includes/skip/elements/forms/select.php
- function get_select( $name, $elements, $label = FALSE, $args = array(), $return = 'html' ) {
- $select = new Select( $name, $label, $args );
- if( count( $elements ) > 0 ):
- if( is_array( $elements ) ):
- foreach ( $elements AS $element )
- $select->add_element( $element );
- else:
- $values = explode( ', ', $elements );
- foreach ( $values AS $value )
- $select->add_element( array( 'value' => $value ) );
- endif;
- endif;
- return $select->render();
- }