public function Indent($code, $spaces)
    {
        $indent = "";
        
        for($i=0; $i<$spaces; $i++)
        {
            $indent .= " ";
        }
        
        if(substr_count($code, "\n") <= 1)
            return $indent . $code;
        
        $code = str_replace("\n", "\n$indent", $code);
        
        return $code;
    }
public function Indent($code, $spaces)
    {
        $indent = "";
        
        for($i=0; $i<$spaces; $i++)
        {
            $indent .= " ";
        }
        
        if(substr_count($code, "\n") <= 1)
            return $indent . $code;
        
        $code = str_replace("\n", "\n$indent", $code);
        
        return $code;
    }
public function Indent ( $ code , $ spaces ) { $ indent = "" ; for ( $ i = 0 ; $ i < $ spaces ; $ i ++ ) { $ indent .= " " ; } if ( substr_count ( $ code , "\n" ) <= 1 ) return $ indent . $ code ; $ code = str_replace ( "\n" , "\n$indent" , $ code ) ; return $ code ; }
Useful to indent the output of a template.
@param string $code Output code of template.
@param int $spaces Amount of spaces to indent the code.
@return string Code indented.
Useful to indent the output of a template .