original_string: public function build($string = '', $groupSeparator = ',', $viewSeparator = ':')
      {
          // Clear options data
          $this->options = array();
  
          // Split string into groups and iterate them
          foreach (explode($groupSeparator, $string) as $group) {
              // Split group into view -> value
              $group = explode($viewSeparator, $group);
  
              // Get value
              $value = $group[0];
  
              // Get view or set value
              $view = isset($group[1]) ? $group[1] : $group[0];
  
              // Add option
              $this->options[$value] = $view;
          }
  
          // Generate options html
          $optionsHTML = '';
          foreach ($this->options as $k => $v) {
              $optionsHTML .= '<option value="' . $k . '"' .
                  ($v == $this->value() ? ' selected' : '') . '>' . $v . '</option>';
          }
          // Save select HTML
          $this->optionsHTML = $optionsHTML;
  
  //        // Chaining
  //        return $this;
      }
code: public function build($string = '', $groupSeparator = ',', $viewSeparator = ':')
      {
          // Clear options data
          $this->options = array();
  
          // Split string into groups and iterate them
          foreach (explode($groupSeparator, $string) as $group) {
              // Split group into view -> value
              $group = explode($viewSeparator, $group);
  
              // Get value
              $value = $group[0];
  
              // Get view or set value
              $view = isset($group[1]) ? $group[1] : $group[0];
  
              // Add option
              $this->options[$value] = $view;
          }
  
          // Generate options html
          $optionsHTML = '';
          foreach ($this->options as $k => $v) {
              $optionsHTML .= '<option value="' . $k . '"' .
                  ($v == $this->value() ? ' selected' : '') . '>' . $v . '</option>';
          }
          // Save select HTML
          $this->optionsHTML = $optionsHTML;
  
  //        // Chaining
  //        return $this;
      }
code_tokens: public function build ( $ string = '' , $ groupSeparator = ',' , $ viewSeparator = ':' ) { // Clear options data $ this -> options = array ( ) ; // Split string into groups and iterate them foreach ( explode ( $ groupSeparator , $ string ) as $ group ) { // Split group into view -> value $ group = explode ( $ viewSeparator , $ group ) ; // Get value $ value = $ group [ 0 ] ; // Get view or set value $ view = isset ( $ group [ 1 ] ) ? $ group [ 1 ] : $ group [ 0 ] ; // Add option $ this -> options [ $ value ] = $ view ; } // Generate options html $ optionsHTML = '' ; foreach ( $ this -> options as $ k => $ v ) { $ optionsHTML .= '<option value="' . $ k . '"' . ( $ v == $ this -> value ( ) ? ' selected' : '' ) . '>' . $ v . '</option>' ; } // Save select HTML $ this -> optionsHTML = $ optionsHTML ; //        // Chaining //        return $this; }
docstring: Parse string into select options
  
  @param string $string 			Input string
  @param string $groupSeparator 	Separator string for groups
  @param string $viewSeparator	Separator string for view/value
  @return Select Chaining
docstring_tokens: Parse string into select options