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;
    }