fixed phpdoc, tweaked doc

This commit is contained in:
Fabien Potencier
2010-12-14 07:54:51 +01:00
parent 16e4c07865
commit e9c329e577
2 changed files with 10 additions and 9 deletions
+1 -1
View File
@@ -226,7 +226,7 @@ Twig extensions are packages that adds new features to Twig. Using an
extension is as simple as using the `addExtension()` method:
[php]
$twig->addExtension(new Twig_Extension_Escaper());
$twig->addExtension(new Twig_Extension_Sandbox());
Twig comes bundled with the following extensions:
+9 -8
View File
@@ -70,15 +70,10 @@ class Twig_NodeVisitor_Optimizer implements Twig_NodeVisitorInterface
}
/**
* Optimizes "for" tag.
* Optimizes "for" tag by removing the "loop" variable creation whenever possible.
*
* This method removes the creation of the "loop" variable when:
*
* * "loop" is not used in the "for" tag
* * and there is no include tag without the "only" attribute
* * and there is no inner-for tag (in which case we would need to check loop.parent usage)
*
* This method should be able to optimize for with inner-for tags.
* @param Twig_NodeInterface $node A Node
* @param Twig_Environment $env The current Twig environment
*/
protected function enterOptimizeFor($node, $env)
{
@@ -118,6 +113,12 @@ class Twig_NodeVisitor_Optimizer implements Twig_NodeVisitorInterface
}
}
/**
* Optimizes "for" tag by removing the "loop" variable creation whenever possible.
*
* @param Twig_NodeInterface $node A Node
* @param Twig_Environment $env The current Twig environment
*/
protected function leaveOptimizeFor($node, $env)
{
if ($node instanceof Twig_Node_For) {