public function theme($themeName = null, array $options = [])
    {
        if (is_array($themeName)) {
            $options = $themeName;
            $themeName = null;
        }

        if ($themeName === null) {
            $default = Configure::read('jQueryUI.defaultTheme');
            $themeName = $default ? $default : 'Jquery.ui-lightness';
        }
        $out = '';
        list($plugin, $theme) = pluginSplit($themeName);
        $plugin = !$plugin ? 'Jquery' : $plugin;
        $out .= (string)$this->_View->Html->css("{$plugin}.ui/{$theme}/theme.css", $options);
        if (Configure::read('debug')) {
            $out .= (string)$this->_View->Html->css("{$plugin}.ui/{$theme}/jquery-ui.css", $options);
        } else {
            $out .= (string)$this->_View->Html->css("{$plugin}.ui/{$theme}/jquery-ui.min.css", $options);
        }

        if (empty($out)) {
            return;
        }

        return $out;
    }
public function theme($themeName = null, array $options = [])
    {
        if (is_array($themeName)) {
            $options = $themeName;
            $themeName = null;
        }

        if ($themeName === null) {
            $default = Configure::read('jQueryUI.defaultTheme');
            $themeName = $default ? $default : 'Jquery.ui-lightness';
        }
        $out = '';
        list($plugin, $theme) = pluginSplit($themeName);
        $plugin = !$plugin ? 'Jquery' : $plugin;
        $out .= (string)$this->_View->Html->css("{$plugin}.ui/{$theme}/theme.css", $options);
        if (Configure::read('debug')) {
            $out .= (string)$this->_View->Html->css("{$plugin}.ui/{$theme}/jquery-ui.css", $options);
        } else {
            $out .= (string)$this->_View->Html->css("{$plugin}.ui/{$theme}/jquery-ui.min.css", $options);
        }

        if (empty($out)) {
            return;
        }

        return $out;
    }
public function theme ( $ themeName = null , array $ options = [ ] ) { if ( is_array ( $ themeName ) ) { $ options = $ themeName ; $ themeName = null ; } if ( $ themeName === null ) { $ default = Configure :: read ( 'jQueryUI.defaultTheme' ) ; $ themeName = $ default ? $ default : 'Jquery.ui-lightness' ; } $ out = '' ; list ( $ plugin , $ theme ) = pluginSplit ( $ themeName ) ; $ plugin = ! $ plugin ? 'Jquery' : $ plugin ; $ out .= ( string ) $ this -> _View -> Html -> css ( "{$plugin}.ui/{$theme}/theme.css" , $ options ) ; if ( Configure :: read ( 'debug' ) ) { $ out .= ( string ) $ this -> _View -> Html -> css ( "{$plugin}.ui/{$theme}/jquery-ui.css" , $ options ) ; } else { $ out .= ( string ) $ this -> _View -> Html -> css ( "{$plugin}.ui/{$theme}/jquery-ui.min.css" , $ options ) ; } if ( empty ( $ out ) ) { return ; } return $ out ; }
Loads all CSS and JS files for the given UI theme.

### Usage

You can indicate UI themes provided by an specific plugin:

```php
// Theme's assets should be located at `MyPlugin/webroot/css/ui/flick/`
$this->jQuery->theme('MyPlugin.flick');
```

If no plugin syntax is given, **Jquery** plugin will be used by default:

```php
// Theme's assets are located at `Jquery/webroot/css/ui/flick/`
$this->jQuery->theme('flick');
```

If you want to use default theme ($themeName = null) and provide some options
(second argument), you can do as follow:

```php
$this->jQuery->theme(['block' => true]);
```

### Theme auto-detect

If no theme is given ($themeName = null) this method will try to:

- Use global parameter `jQueryUI.defaultTheme`.
- Use `Jquery.ui-lightness` otherwise.

### Default theme

You can define the global parameter `jQueryUI.defaultTheme` in your site's
`bootstrap.php` to indicate the theme to use by default. For instance:

```php
Configure::write('jQueryUI.defaultTheme', 'MyPlugin.ui-darkness');
```

The `MyPlugin.ui-darkness` theme will be used by default every time this
method is used with no arguments:

```php
$this->jQuery->theme();
```

Theme's assets should be located at `MyPlugin/webroot/css/ui/ui-darkness/`

### Options

- `block` Set to true to append output to view block "css" or provide
custom block name.

- `once` Whether or not the css file should be checked for uniqueness. If
true css files  will only be included once, use false to allow the same
css to be included more than once per request.

- `plugin` False value will prevent parsing path as a plugin.

- `rel` Defaults to 'stylesheet'. If equal to 'import' the stylesheet will be
imported.

- `fullBase` If true the URL will get a full address for the css file.

@param string|array|null $themeName Name of the theme to load, or array
of options (will replace $options) to use default theme with options
@param array $options Array of options and HTML arguments
@return string CSS <link /> or <style /> tag, depending on the type of link.
Loads all CSS and JS files for the given UI theme .