Commit Graph

129 Commits

Author SHA1 Message Date
Fabien Potencier b792382126 added the merge filter 2010-12-16 08:10:41 +01:00
Fabien Potencier 2e55141431 moved the i18n extension to the Twig Extensions repository 2010-12-15 08:32:25 +01:00
Fabien Potencier 9e5b2becf4 made some tweak to the security check for the filesystem loader 2010-12-14 17:24:03 +01:00
Fabien Potencier 3c01290c66 fixed usage of operators as method names (like is, in, and not) 2010-12-14 15:20:49 +01:00
Fabien Potencier 2e08bd705c changed the order of execution for node visitors 2010-12-14 15:09:27 +01:00
Fabien Potencier efdcb8c6f4 fixed security check in filesystem loader 2010-12-14 14:36:45 +01:00
Fabien Potencier 090270a509 added some unit tests for the filesystem loader 2010-12-14 14:28:47 +01:00
Fabien Potencier e0ea4a962a fixed default() filter behavior when used with strict_variables set to on 2010-12-14 14:27:28 +01:00
Fabien Potencier 28f4cb749e tweaked last commit 2010-12-14 11:50:47 +01:00
Mark Story 339eb082ed Adding Twig_Environment::clearCacheFiles() to clear cache files that twig makes.
Refactoring test cases in previous commit.  Adding more tests for clearing cache files.
Fixes #192
2010-12-14 11:48:33 +01:00
Mark Story d660ec6619 Adding a test case for caching template class to the filesystem. 2010-12-14 11:48:24 +01:00
Fabien Potencier 4505200d9f changed array/hashes notation 2010-12-14 09:33:07 +01:00
Fabien Potencier ac0b54c141 removed the 'without loop' attribute for the 'for' tag 2010-12-13 15:59:12 +01:00
Fabien Potencier 8cd9bcb775 enhanced the for-loop optimizer pass 2 (patch from nikic) 2010-12-13 15:46:09 +01:00
Fabien Potencier e0f20a0c4d enhanced the for-loop optimizer (patch from nikic) 2010-12-13 15:20:03 +01:00
Fabien Potencier 77bec04874 removed the newline after a comment (closes #195) 2010-12-10 07:13:32 +01:00
Fabien Potencier 031bf84b25 fixed parentheses placement for the ternary operator 2010-12-02 14:33:10 +01:00
Fabien Potencier c79bb17c93 fixed escaper when wrapping a Twig_Node_Print (the original class must be preserved) 2010-12-02 08:51:53 +01:00
Fabien Potencier 7f07cf0d57 renamed a test 2010-12-02 08:31:32 +01:00
Arnaud Le Blanc 7284fa9829 fix parsing of postfix expressions 2010-11-29 08:05:26 +01:00
Fabien Potencier 15e6682421 made some small changes to the previous commit 2010-11-28 17:14:26 +01:00
Jordi Boggiano 0e1b2ca857 Added joined by statement to for loops 2010-11-28 17:10:03 +01:00
Fabien Potencier bd5629b3f2 added an Optimizer extension 2010-11-28 15:30:05 +01:00
Fabien Potencier c3b595281e removed obsolete option in unit tests 2010-11-28 14:28:07 +01:00
Arnaud Le Blanc d35e19fe22 Added "pre_escape" option for filters
This allows filters to get their input pre-escaped for a given context
2010-11-28 08:14:32 +01:00
Fabien Potencier c66ab82354 made error message for strict variables more useful 2010-11-27 11:15:27 +01:00
Fabien Potencier 7cdada5d05 fixed __toString() calls when sandbox is enabled 2010-11-26 22:15:05 +01:00
Fabien Potencier 903e3d9860 fixed a warning and added some unit tests 2010-11-26 19:11:59 +01:00
Fabien Potencier a511b9bd64 fixed several bugs in SimpleTokenParser (nested optional grammar, and support for , as a separator) 2010-11-26 18:58:54 +01:00
Fabien Potencier 9d8583efcc rewrote expression parser with a new algorithm to limit the depth of nested calls
This change has no impact for the end user, but many internal benefits:

* less nested calls (was the primary reason for the change as xdebug limits the depth of nested calls);
* less code;
* code is much cleaner (I have removed all the parsing "hacks");
* faster;
* more flexible (we will now be able to expose an API to add new operators);
* easier to maintain.
2010-11-26 16:35:59 +01:00
Fabien Potencier 485406036f added some missing tests 2010-11-25 17:11:24 +01:00
Fabien Potencier 1d2afa097f added the spaceless tag 2010-11-19 13:26:23 +01:00
Arnaud Le Blanc 15e46e598d Changed Twig_Node_Expression_Filter to accept only one filter
Chained filters are now represented by nested
Twig_Node_Expression_Filter nodes internally.

This makes it easier to analyse the tree
2010-11-19 08:06:32 +01:00
Fabien Potencier 7ea98b6c90 moved all exceptions to Twig_Error_* 2010-11-07 22:18:31 +01:00
Fabien Potencier 7d78ab416d fixed unary expressions 2010-11-07 21:44:05 +01:00
Fabien Potencier 011e727b22 fixed documentation and added infix notation for in (already supported for is) 2010-11-07 14:21:10 +01:00
Fabien Potencier e482038098 changed how nl2br is implemented in tests to better reflect how it should be done in userland code 2010-11-07 09:58:28 +01:00
Arnaud Le Blanc 4087d087a1 deeply mark expressions as safe (e.g. a conditonal expression is safe if both operands are literals) 2010-11-07 08:52:12 +01:00
Arnaud Le Blanc 123caccc80 support for specifying the escaping type of a filter 2010-11-07 08:52:06 +01:00
Arnaud Le Blanc 510e96275c Changed escaping rules (switched to post-escaping)
Expression in Print nodes are always escaped before being printed,
except in two conditions :
  * if the expression is an Expression_Constant node
  * if the last filter in the chain is an escaper
2010-11-07 08:52:03 +01:00
Fabien Potencier 10cab46129 made the include tag more flexible 2010-11-01 04:24:32 +01:00
Fabien Potencier da08fe70c4 fixed a unit test so that it works for more PHP versions 2010-10-26 19:49:31 +02:00
Fabien Potencier 29b020eb2f changed the way to access nodes and attributes from a node
Before:
  Nodes were accessed via node properties ($node->body)
  Attributes were accessed via node array access ($node['name'])

After:
  Nodes are accessed via getNode(), setNode(), ... ($node->getNode('body'))
  Attributes are accessed via getAttribute(), setAttribute(), ... ($node->getAttribute('name'))

The change was necessary because of side-effects. This is one more time the
demonstration that being explicit is always better than magic ;)
2010-10-02 08:29:25 +02:00
henrikbjorn 56caee0937 renamed |safe to |raw to avoid unnecesarry confusion about what the tags does.
Discussion can be viewed here http://groups.google.com/group/symfony-devs/browse_thread/thread/b927063310c74411. All tests pass.
2010-10-01 19:17:22 +02:00
Fabien Potencier 15f3276676 changed the implementation of template inheritance 2010-10-01 14:17:16 +02:00
Arnaud Le Blanc 4541e88e51 fixed js escaper to be stricter, whilelist-based js escaper (closes #114) 2010-09-14 09:39:10 +02:00
Fabien Potencier 5a354ea859 made a small update to doc and rename a test file 2010-09-12 08:01:34 +02:00
Fabien Potencier 1cf01ce927 added a constant filter (refs #120) 2010-09-12 08:00:21 +02:00
Mark Story 1e9493df29 added the constant() test (closes #120) 2010-09-12 07:50:05 +02:00
Mark Story 2ff6cedbf8 fixed objects with __toString() not being autoescaped (fixes #111) 2010-09-12 07:44:26 +02:00