protected function _response($type, $string, $options)
{
$defaults = array('nl' => 1, 'style' => null);
if (!is_array($options)) {
if (is_bool($options)) {
$options = array('nl' => (int) $options);
} elseif (is_int($options)) {
$options = array('nl' => $options);
} elseif (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;
}
if ($options['style'] !== null && !$this->plain) {
$string = "{:{$options['style']}}{$string}{:end}";
}
if ($options['nl']) {
$string = $string . $this->nl((int) $options['nl']);
}
return $this->response->{$type}($string);
}