green() public method

Returns a green version of $text.
public green ( string $text ) : string
$text string The text to print in green.
return string The green text.
Example #1
0
 public function green($text)
 {
     if ($this->_nocolor) {
         $this->_cli->writeln($text);
     } else {
         $this->_cli->writeln($this->_cli->green($text));
     }
 }
Example #2
0
#!/usr/bin/env php
<?php 
/**
 * @package Cli
 */
require 'Horde/Cli.php';
$cli = new Horde_Cli();
/* Explicit colors */
$cli->writeln($cli->red('Red'));
$cli->writeln($cli->yellow('Yellow'));
$cli->writeln($cli->green('Green'));
$cli->writeln($cli->blue('Blue'));
$cli->writeln();
/* These messages are automatically colorized based on the message type. */
$cli->message('test', 'cli.error');
$cli->message('test', 'cli.warning');
$cli->message('test', 'cli.success');
$cli->message('test', 'cli.message');