Skip to content

Commit

Permalink
fix highlighting of snippet in recipes doc
Browse files Browse the repository at this point in the history
  • Loading branch information
igorw committed Jul 31, 2011
1 parent f918219 commit 0580f19
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions doc/recipes.rst
Expand Up @@ -246,14 +246,14 @@ Validating the Template Syntax
When template code is providing by a third-party (through a web interface for
instance), it might be interesting to validate the template syntax before
saving it. If the template code is stored in a `$template` variable, here is
how you can do it:
how you can do it::

try {
$twig->parse($twig->tokenize($template));
try {
$twig->parse($twig->tokenize($template));

// the $template is valid
} catch (Twig_Error_Syntax $e) {
// $template contains one or more syntax errors
}
// the $template is valid
} catch (Twig_Error_Syntax $e) {
// $template contains one or more syntax errors
}

.. _callback: http://www.php.net/manual/en/function.is-callable.php

0 comments on commit 0580f19

Please sign in to comment.