Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed extracting template strings example.

  • Loading branch information...
commit dc5580fd03fa501b8bc27613e1329b2aa492e49c 1 parent 7669b6b
@umpirsky umpirsky authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 doc/i18n.rst
View
6 doc/i18n.rst
@@ -141,8 +141,10 @@ templates. Here is a simple example to get you started::
// iterate over all your templates
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($tplDir), RecursiveIteratorIterator::LEAVES_ONLY) as $file)
{
- // force compilation
- $twig->loadTemplate(str_replace($tplDir.'/', '', $file));
+ // force compilation
+ if ($file->isFile()) {
+ $twig->loadTemplate(str_replace($tplDir.'/', '', $file));
+ }
}
Use the standard ``xgettext`` utility as you would have done with plain PHP
Please sign in to comment.
Something went wrong with that request. Please try again.