green() public méthode

Returns a green version of $text.
public green ( string $text ) : string
$text string The text to print in green.
Résultat string The green text.
Exemple #1
0
 public function green($text)
 {
     if ($this->_nocolor) {
         $this->_cli->writeln($text);
     } else {
         $this->_cli->writeln($this->_cli->green($text));
     }
 }
Exemple #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');