Skip to content

Commit

Permalink
Fix after($output) example in README [#42 state:resolved]
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabrice Luraine committed Oct 16, 2010
1 parent 9365925 commit 8202fee
Showing 1 changed file with 27 additions and 21 deletions.
48 changes: 27 additions & 21 deletions README.mkd
Expand Up @@ -457,13 +457,15 @@ The current matching route is also passed to the before function, so you can tes

An `after` output filter is also available. It's executed after each request and can apply a transformation to the output (except for `render_file` outputs which are sent directly to the output buffer).

function after($output, $route){
$config = array('indent' => TRUE,
'output-xhtml' => TRUE,
'wrap' => 200);

$tidy = tidy_parse_string($output, $config, option('encoding'));
return $tidy->cleanRepair();
function after($output){
$config = array('indent' => TRUE,
'output-xhtml' => TRUE,
'wrap' => 200);
$encoding = strtoupper(str_replace('-','', option('encoding')));
$tidy = tidy_parse_string($output, $config, $encoding);
$tidy->cleanRepair();
return $tidy;
}

The current executed route is also available for `after` function.
Expand Down Expand Up @@ -1164,13 +1166,15 @@ The current matching route is also passed to the before function, so you can tes

An `after` output filter is also available. It's executed after each request and can apply a transformation to the output (except for `render_file` outputs which are sent directly to the output buffer).

function after($output, $route){
$config = array('indent' => TRUE,
'output-xhtml' => TRUE,
'wrap' => 200);

$tidy = tidy_parse_string($output, $config, option('encoding'));
return $tidy->cleanRepair();
function after($output){
$config = array('indent' => TRUE,
'output-xhtml' => TRUE,
'wrap' => 200);
$encoding = strtoupper(str_replace('-','', option('encoding')));
$tidy = tidy_parse_string($output, $config, $encoding);
$tidy->cleanRepair();
return $tidy;
}

The current executed route is also available for `after` function.
Expand Down Expand Up @@ -1871,13 +1875,15 @@ The current matching route is also passed to the before function, so you can tes

An `after` output filter is also available. It's executed after each request and can apply a transformation to the output (except for `render_file` outputs which are sent directly to the output buffer).

function after($output, $route){
$config = array('indent' => TRUE,
'output-xhtml' => TRUE,
'wrap' => 200);

$tidy = tidy_parse_string($output, $config, option('encoding'));
return $tidy->cleanRepair();
function after($output){
$config = array('indent' => TRUE,
'output-xhtml' => TRUE,
'wrap' => 200);
$encoding = strtoupper(str_replace('-','', option('encoding')));
$tidy = tidy_parse_string($output, $config, $encoding);
$tidy->cleanRepair();
return $tidy;
}

The current executed route is also available for `after` function.
Expand Down

0 comments on commit 8202fee

Please sign in to comment.