styles() public method

### Get a style definition $output->styles('error'); ### Get all the style definitions $output->styles(); ### Create or modify an existing style $output->styles('annoy', ['text' => 'purple', 'background' => 'yellow', 'blink' => true]); ### Remove a style $this->output->styles('annoy', false);
public styles ( string | null $style = null, array | boolean | null $definition = null ) : mixed
$style string | null The style to get or create.
$definition array | boolean | null The array definition of the style to change or create a style or false to remove a style.
return mixed If you are getting styles, the style or null will be returned. If you are creating/modifying styles true will be returned.
Beispiel #1
0
 /**
  * Add a new output style or get defined styles.
  *
  * @param string $style The style to get or create.
  * @param array|bool|null $definition The array definition of the style to change or create a style
  *   or false to remove a style.
  * @return mixed If you are getting styles, the style or null will be returned. If you are creating/modifying
  *   styles true will be returned.
  * @see \Cake\Console\ConsoleOutput::styles()
  */
 public function styles($style = null, $definition = null)
 {
     $this->_out->styles($style, $definition);
 }