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

  1. if ( !function_exists( 'skip\v1_0_0\get_select' ) ) { 
  2. require_once '/includes/skip/elements/forms/select.php'; 
  3.  
  4. // The name. 
  5. $name = ''; 
  6.  
  7. // The elements. 
  8. $elements = null; 
  9.  
  10. // The label. 
  11. $label = FALSE; 
  12.  
  13. // The args. 
  14. $args = array(); 
  15.  
  16. // The return. 
  17. $return = 'html'; 
  18.  
  19. // NOTICE! Understand what this does before running. 
  20. $result = skip\v1_0_0\get_select($name, $elements, $label, $args, $return); 
  21.  

Defined (1)

The function is defined in the following location(s).

/includes/skip/elements/forms/select.php  
  1. function get_select( $name, $elements, $label = FALSE, $args = array(), $return = 'html' ) { 
  2. $select = new Select( $name, $label, $args ); 
  3.  
  4. if( count( $elements ) > 0 ): 
  5. if( is_array( $elements ) ): 
  6. foreach ( $elements AS $element ) 
  7. $select->add_element( $element ); 
  8. else: 
  9. $values = explode( ', ', $elements ); 
  10. foreach ( $values AS $value ) 
  11. $select->add_element( array( 'value' => $value ) ); 
  12. endif; 
  13. endif; 
  14.  
  15. return $select->render(); 
  16. }