Commit Graph

64 Commits

Author SHA1 Message Date
Fabien Potencier 57f2853320 removed getName() method in Twig_Template 2010-06-12 15:43:36 +02:00
Fabien Potencier cb34e7cb97 made a big performance optimization when strict_variables is not set 2010-06-12 15:22:07 +02:00
Fabien Potencier a8031fc96a added self variable, simplified macro management, added some more documentation for macros (closes #61) 2010-06-12 11:27:41 +02:00
Fabien Potencier c017a93e77 fixed a bug when a template with a layout is reused more than one time 2010-06-11 12:10:32 +02:00
Fabien Potencier f87df8a2fb fixed escaping for filtered object attributes (closes #59) 2010-06-11 07:20:38 +02:00
Fabien Potencier 40b16eccf8 fixed infinite loop in inheritance (closes #66) 2010-06-11 07:10:43 +02:00
Fabien Potencier 7e926fc235 added Twig_Template instance support to the include tag 2010-06-10 10:08:38 +02:00
Fabien Potencier 0f51a54fc9 added support for dynamic and conditional inheritance ({% extends some_var %} and {% extends standalone ? minimum : base %}) 2010-06-09 23:05:45 +02:00
Fabien Potencier 8809a1cab1 changed as to = for the set tag and removed the need for as in short-notation of the block tag (closes #54) 2010-06-09 08:20:51 +02:00
Fabien Potencier 0ca17abc71 added a grammar to easily describe a tag syntax with a string 2010-06-08 16:31:06 +02:00
Fabien Potencier 3fb36c0fcb moved the unit test bootstrap file to a more obvious place 2010-06-08 16:13:00 +02:00
Fabien Potencier dc37698ce0 changed order of Twig_Node_Expression_GetAttr constructor arguments 2010-06-07 14:28:22 +02:00
Fabien Potencier d47902c7b9 fixed the for tag for large arrays (closes #64 - based on an idea from gwilym - aeb56f9f966bd23b77d35c87999be0606dbb3f47) 2010-06-07 11:04:23 +02:00
Fabien Potencier f2bb0aa911 made Resource::getAttribute() more generic (WIP) 2010-06-07 10:41:15 +02:00
Fabien Potencier 56318ee4a8 made a big refactoring of Twig internals (and added a bunch of unit tests and phpdoc, fixes #53) 2010-06-03 08:12:58 +02:00
Fabien Potencier bf31f2f7e0 made error messages in tests more explicit about where the error occurred 2010-06-01 14:24:56 +02:00
Fabien Potencier 21e5397f3b made error messages in tests more explicit about where the error occurred 2010-06-01 13:22:58 +02:00
Fabien Potencier a412dfbb9c added bootstrap option to phpunit.xml 2010-05-28 08:27:32 +02:00
Fabien Potencier 1847634d0c changed the date filter to support any date format supported by DateTime (closes #56) 2010-05-27 18:32:02 +02:00
Fabien Potencier b63205a6c4 fixed sandbox mode (__toString() method check was not enforced if called implicitly from a simple statement like {{ article }}) 2010-05-25 18:01:55 +02:00
Fabien Potencier 7ab6dbc16b disabled the cache when testing the sandbox 2010-05-25 17:58:14 +02:00
Fabien Potencier 7603ef193b changed the grammar for the short-notation of the block tag to be more consistent with other tags 2010-05-25 16:43:30 +02:00
Fabien Potencier 2e1b12bcce fixed variables defined outside a loop and for which the value changes in a for loop (closes #43) 2010-05-11 11:54:06 +02:00
Fabien Potencier 29edbed252 added the fixture file in error message to ease debugging tests 2010-05-11 11:52:25 +02:00
Fabien Potencier 4d8fc51112 changed coding standards 2010-05-11 10:38:48 +02:00
Fabien Potencier 550edefdef made the test suite more compatible with old versions of PHPUnit 2010-05-10 19:30:00 +02:00
Fabien Potencier dc7a48eed1 removed \ in the test suite to make it compatible with PHP 5.2 2010-05-10 19:26:49 +02:00
Fabien Potencier 889a846f50 removed \ in the test suite to make it compatible with PHP 5.2 2010-05-10 19:25:50 +02:00
Fabien Potencier 79e5058611 added support for __call() in expression resolution (closes #2)
The new algorithm for object method resolution is now the following:

  * get all methods declared for `$object` using ReflectionObject::getMethods()
  * check if `$item` is in the list of method names
  * check if `get$item` is in the list of method names
  * check if `__call` is defined and pass `$item` as the method name
2010-05-10 12:47:39 +02:00
Fabien Potencier 23a8d39d66 fixed nested block definitions with a parent call (closes #45) 2010-04-29 07:58:52 +02:00
James Logsdon 0593d7fb48 fixed test that referenced a class from another test 2010-03-29 09:04:43 +02:00
Fabien Potencier 075f541547 added the cycle filter (closes #26) 2010-03-28 15:25:15 +02:00
Fabien Potencier 7e8cdd7b4f switched to PHPUnit for testing 2010-03-19 15:32:39 +01:00
Fabien Potencier 6c7d5603ea added support for escaping strategy in the autoescape tag (closes #19) 2010-03-04 11:08:16 +01:00
fabien b8cf67ab51 removed obsolete code in fixtures
git-svn-id: http://svn.twig-project.org/trunk@215 93ef8e89-cb99-4229-a87c-7fa0fa45744b
2010-01-08 13:14:39 +00:00
fabien 575ed89d19 added the // operator (like in Jinja2, closes #44)
git-svn-id: http://svn.twig-project.org/trunk@208 93ef8e89-cb99-4229-a87c-7fa0fa45744b
2010-01-06 08:19:36 +00:00
fabien 410a517348 added missing test
git-svn-id: http://svn.twig-project.org/trunk@203 93ef8e89-cb99-4229-a87c-7fa0fa45744b
2009-12-22 14:13:46 +00:00
fabien 7f6f7bb287 added support for a trailing , when defining arrays
git-svn-id: http://svn.twig-project.org/trunk@196 93ef8e89-cb99-4229-a87c-7fa0fa45744b
2009-12-22 07:35:57 +00:00
fabien 5f049939ef fixed escaping when getattr nodes are used
git-svn-id: http://svn.twig-project.org/trunk@194 93ef8e89-cb99-4229-a87c-7fa0fa45744b
2009-12-22 07:06:39 +00:00
fabien 490913c103 added a unit test to prove that blocks are escaped
git-svn-id: http://svn.twig-project.org/trunk@193 93ef8e89-cb99-4229-a87c-7fa0fa45744b
2009-12-22 06:47:45 +00:00
fabien 8d1648e5bd fixed error reporting in integration tests
git-svn-id: http://svn.twig-project.org/trunk@192 93ef8e89-cb99-4229-a87c-7fa0fa45744b
2009-12-22 06:44:59 +00:00
fabien 80871d95bc added some tests
git-svn-id: http://svn.twig-project.org/trunk@191 93ef8e89-cb99-4229-a87c-7fa0fa45744b
2009-12-15 14:37:47 +00:00
fabien e2c7b2fadd added a way to specify variables to pass to an included template
git-svn-id: http://svn.twig-project.org/trunk@190 93ef8e89-cb99-4229-a87c-7fa0fa45744b
2009-12-15 08:01:13 +00:00
fabien dfca5a153a fixed typo in a test fixture
git-svn-id: http://svn.twig-project.org/trunk@185 93ef8e89-cb99-4229-a87c-7fa0fa45744b
2009-12-15 06:53:28 +00:00
fabien 9d4ceb4563 changed the automatic-escaping rules to be more sensible (the documentation lists all the rules)
git-svn-id: http://svn.twig-project.org/trunk@182 93ef8e89-cb99-4229-a87c-7fa0fa45744b
2009-12-14 16:57:54 +00:00
fabien 2ab4dd5be0 added the .. operator as a syntactic sugar for the range filter when the step is 1
git-svn-id: http://svn.twig-project.org/trunk@173 93ef8e89-cb99-4229-a87c-7fa0fa45744b
2009-12-13 15:13:38 +00:00
fabien 95d5cefdd7 added the in operator
git-svn-id: http://svn.twig-project.org/trunk@170 93ef8e89-cb99-4229-a87c-7fa0fa45744b
2009-12-13 13:03:07 +00:00
fabien 4c55be6dda added tests for the in filter
git-svn-id: http://svn.twig-project.org/trunk@169 93ef8e89-cb99-4229-a87c-7fa0fa45744b
2009-12-13 12:55:04 +00:00
fabien 516a5d7a85 added test for DateTime support in the date filter
git-svn-id: http://svn.twig-project.org/trunk@168 93ef8e89-cb99-4229-a87c-7fa0fa45744b
2009-12-13 12:45:06 +00:00
fabien ee5c9d9363 added support for arrays (closes #50)
git-svn-id: http://svn.twig-project.org/trunk@162 93ef8e89-cb99-4229-a87c-7fa0fa45744b
2009-12-13 10:54:01 +00:00