Text_Highlighter_Renderer_Array::getOutput PHP Method

getOutput() public method

Get generated output
public getOutput ( ) : array
return array Highlighted code as an array
    function getOutput()
    {
        return $this->_output;
    }

Usage Example

 function finalize()
 {
     // get parent's output
     parent::finalize();
     $output = parent::getOutput();
     $tex_output = '';
     foreach ($output as $token) {
         if ($this->_enumerated) {
             $class = $token[0];
             $content = $token[1];
         } else {
             $key = key($token);
             $class = $key;
             $content = $token[$key];
         }
         $iswhitespace = ctype_space($content);
         if (!$iswhitespace) {
             if ($class === 'special') {
                 $class = 'code';
             }
             $tex_output .= sprintf('\\textcolor{%s}{%s}', $class, $this->escape($content));
         } else {
             $tex_output .= $content;
         }
     }
     $this->_output = "\\begin{alltt}\n" . $tex_output . "\\end{alltt}";
 }
All Usage Examples Of Text_Highlighter_Renderer_Array::getOutput