original_string: public function ui()
      {
          $args = func_get_args();
          $files = [];
          $options = [];
          $out = '';
  
          foreach ($args as $file) {
              if (is_array($file)) {
                  $options = $file;
                  continue;
              }
  
              $file = 'Jquery.ui/' . strtolower($file);
              if (!str_ends_with($file, '.js')) {
                  $file .= '.js';
              }
  
              if ($file != 'Jquery.ui/core.js') {
                  $files[] = $file;
              }
          }
  
          if (empty($files)) {
              $files[] = Configure::read('debug') ? 'Jquery.jquery-ui.js' : 'Jquery.jquery-ui.min.js';
          } else {
              array_unshift($files, 'Jquery.ui/core.js');
          }
  
          foreach ($files as $file) {
              $out .= (string)$this->_View->Html->script($file, $options);
          }
  
          if (empty($out)) {
              return null;
          }
  
          return $out;
      }
code: public function ui()
      {
          $args = func_get_args();
          $files = [];
          $options = [];
          $out = '';
  
          foreach ($args as $file) {
              if (is_array($file)) {
                  $options = $file;
                  continue;
              }
  
              $file = 'Jquery.ui/' . strtolower($file);
              if (!str_ends_with($file, '.js')) {
                  $file .= '.js';
              }
  
              if ($file != 'Jquery.ui/core.js') {
                  $files[] = $file;
              }
          }
  
          if (empty($files)) {
              $files[] = Configure::read('debug') ? 'Jquery.jquery-ui.js' : 'Jquery.jquery-ui.min.js';
          } else {
              array_unshift($files, 'Jquery.ui/core.js');
          }
  
          foreach ($files as $file) {
              $out .= (string)$this->_View->Html->script($file, $options);
          }
  
          if (empty($out)) {
              return null;
          }
  
          return $out;
      }
code_tokens: public function ui ( ) { $ args = func_get_args ( ) ; $ files = [ ] ; $ options = [ ] ; $ out = '' ; foreach ( $ args as $ file ) { if ( is_array ( $ file ) ) { $ options = $ file ; continue ; } $ file = 'Jquery.ui/' . strtolower ( $ file ) ; if ( ! str_ends_with ( $ file , '.js' ) ) { $ file .= '.js' ; } if ( $ file != 'Jquery.ui/core.js' ) { $ files [ ] = $ file ; } } if ( empty ( $ files ) ) { $ files [ ] = Configure :: read ( 'debug' ) ? 'Jquery.jquery-ui.js' : 'Jquery.jquery-ui.min.js' ; } else { array_unshift ( $ files , 'Jquery.ui/core.js' ) ; } foreach ( $ files as $ file ) { $ out .= ( string ) $ this -> _View -> Html -> script ( $ file , $ options ) ; } if ( empty ( $ out ) ) { return null ; } return $ out ; }
docstring: Loads the given jQuery UI components JS files.
  
  You can indicate the name of the JS files to include as follow:
  
  ```php
  $this->jQuery->ui('mouse', 'droppable', 'widget', ...);
  ```
  
  You can provide an array of options for HtmlHelper::script() as follow:
  
  ```php
  $this->jQuery->ui('mouse', 'droppable', ['block' => 'true'], 'widget', ...);
  ```
  
  If no component is given, all components (concatenated as a single JS file)
  will be loaded at once.
  
  @return mixed String of `<script />` tags or null if block is specified in
  options or if $once is true and the file has been included before
docstring_tokens: Loads the given jQuery UI components JS files .