Extends
lithium\core\Object
Handles the response that is sent to the stream.
Parameters
- string $type the stream either output or error
- string $string the message to render
- integer|string|array $options integer as the number of new lines. string as the style array as : - nl : number of new lines to add at the end - style : the style name to wrap around the
Returns
voidSource
protected function _response($type, $string, $options) {
$defaults = array('nl' => 1, 'style' => null);
if (!is_array($options)) {
if (!$options || is_int($options)) {
$options = array('nl' => $options);
} else if (is_string($options)) {
$options = array('style' => $options);
} else {
$options = array();
}
}
$options += $defaults;
if (is_array($string)) {
$method = ($type == 'error' ? $type : 'out');
foreach ($string as $out) {
$this->{$method}($out, $options);
}
return;
}
extract($options);
if ($style !== null) {
$string = "{:{$style}}{$string}{:end}";
}
if ($nl) {
$string = $string . $this->nl($nl);
}
return $this->response->{$type}($string);
}