Commit Graph

2195 Commits

Author SHA1 Message Date
Julian b7095770e2 Added additional example to min/max doc 2014-02-24 16:39:24 +01:00
Fabien Potencier 9ed963c99d minor #1323 Added a more clear example in the cycle() docs (brandonkelly)
This PR was merged into the 1.15-dev branch.

Discussion
----------

Added a more clear example in the cycle() docs

We've receive a lot of feedback that the examples for the cycle() tag could be better, so I figured I'd contribute one.

The previous example was potentially misleading if you were focussed on the actual numbers (0 is even, not odd! etc.), and 99% of the time you’re going to be passing loop.index0 into cycle, so I felt that should be included in the example.

I realize that this one requires a little additional setup, but I think the fact that it's a real-world example makes it worth it.

Commits
-------

8958565 Added a more clear example in the cycle() docs
2014-01-24 16:03:15 +01:00
Brandon Kelly 8958565cef Added a more clear example in the cycle() docs
The previous one was potentially misleading if you were focussed on the actual numbers (0 is even, not odd! etc.), and 99% of the time you’re going to be passing loop.index0 into cycle, so I felt that should be included in the example.
2014-01-24 04:27:48 -08:00
Fabien Potencier ae89c88535 updated LICENSE years 2014-01-08 08:21:35 +01:00
Fabien Potencier 4983af78f7 minor #1303 Improved exception message for accessing object (without ArrayAccess) as array (hason)
This PR was merged into the 1.15-dev branch.

Discussion
----------

Improved exception message for accessing object (without ArrayAccess) as array

Commits
-------

770712b Improved exception message for accessing object without ArrayAccess as array
2014-01-05 17:48:49 +01:00
Fabien Potencier 693c0e6f3c removed HHVM from the allowed failures 2014-01-05 17:46:03 +01:00
Fabien Potencier abb1815093 minor #1312 made some minor tweaks to PHPUnit assertions (fabpot)
This PR was merged into the 1.15-dev branch.

Discussion
----------

made some minor tweaks to PHPUnit assertions

Commits
-------

e5e2a01 made some minor tweaks to PHPUnit assertions
2014-01-05 17:41:06 +01:00
Fabien Potencier e5e2a01051 made some minor tweaks to PHPUnit assertions 2014-01-05 17:26:18 +01:00
Fabien Potencier f3f5f0aba7 bug #1311 fixed the conversion of the special '0000-00-00 00:00' date (fabpot)
This PR was merged into the 1.15-dev branch.

Discussion
----------

fixed the conversion of the special '0000-00-00 00:00' date

This PR reverts #1234 and add supports for PHP 5.5 is a simpler way. This also fixes #1241 and closes #1242.

Commits
-------

9b95570 fixed the conversion of the special '0000-00-00 00:00' date
2014-01-05 01:05:42 +01:00
Fabien Potencier 9b95570829 fixed the conversion of the special '0000-00-00 00:00' date 2014-01-05 01:00:18 +01:00
Martin Hasoň 770712b4c0 Improved exception message for accessing object without ArrayAccess as array 2013-12-31 22:30:37 +01:00
Fabien Potencier 27f3e0fc1e fixed Filesystem::exists() to normalize the template name before checking the cache 2013-12-27 15:37:02 +01:00
Fabien Potencier 46b3e844a0 minor #1284 Simple enhancement for easy overloading (arnapou)
This PR was squashed before being merged into the 1.15-dev branch (closes #1284).

Discussion
----------

Simple enhancement for easy overloading

More consistent algorithm which allow people to easily overload normalize method to their needs.

Commits
-------

87d4f08 Simple enhancement for easy overloading
2013-12-27 15:35:40 +01:00
Arnaud Buathier 87d4f083bb Simple enhancement for easy overloading 2013-12-27 15:35:40 +01:00
Fabien Potencier 2b0b904340 minor #1290 [Docs] Fix example: space missing between concatenated strings (GromNaN)
This PR was merged into the 1.15-dev branch.

Discussion
----------

[Docs] Fix example: space missing between concatenated strings

The expression `'Hello'~'Fabien'` produces `'HelloFabien'`, not `'Hello Fabien'`. I've just added a space after `'Hello'`.

Commits
-------

d6e0357 Fix doc example: space missing between concatenated strings
2013-12-27 15:27:14 +01:00
Fabien Potencier cb43b1234d Revert "merged branch javer/hhvm-array-traversable (PR #1192)"
This reverts commit 0d97eb9528, reversing
changes made to 4fcaf0c5fc.

This change is not needed anymore as HHVM has been fixed as of 2.3.0.
2013-12-27 15:21:16 +01:00
Fabien Potencier 81ef1380ee fixed Travis config to allow HHVM to fail 2013-12-27 15:13:51 +01:00
Fabien Potencier 996c286fdd minor #1294 Add HHVM to build matrix (ptarjan)
This PR was squashed before being merged into the 1.15-dev branch (closes #1294).

Discussion
----------

Add HHVM to build matrix

Now that HHVM can run your project, lets keep it that way

Commits
-------

e03b05e Add HHVM to build matrix
2013-12-27 15:12:46 +01:00
Paul Tarjan e03b05e0dc Add HHVM to build matrix 2013-12-27 15:12:45 +01:00
Fabien Potencier 6387fc4577 minor #1291 Fixed rendering of `-3` (ureimers)
This PR was merged into the master branch.

Discussion
----------

Fixed rendering of ``-3``

The missing space between "``-3``" and "(this is just syntactic[...])" led to the ``-3`` being rendered wrong. The parser must've ignored the closing "``" when it was directly followed by a non-space character.

Commits
-------

d8ea1b1 Fixed rendering of ``-3``
2013-12-10 11:23:00 +01:00
ureimers d8ea1b1784 Fixed rendering of `-3`
The missing space between "``-3``" and "(this is just syntactic[...])" led to the ``-3`` being rendered wrong. The parser must've ignored the closing "``" when it was directly followed by a non-space character.
2013-12-10 11:19:22 +01:00
Jérôme Tamarelle d6e03576f6 Fix doc example: space missing between concatenated strings 2013-12-07 20:09:53 +01:00
Fabien Potencier d5984bbb05 bug #1288 added an error message when trying to import an undefined block from a trait (fabpot)
This PR was merged into the master branch.

Discussion
----------

added an error message when trying to import an undefined block from a trait

Commits
-------

a2c6db7 added an error message when trying to import an undefined block from a trait
2013-12-06 16:28:39 +01:00
Fabien Potencier a2c6db7ea7 added an error message when trying to import an undefined block from a trait 2013-12-06 11:06:49 +01:00
Fabien Potencier 7066ce68ad bumped version to 1.15.1-DEV 2013-12-06 09:13:22 +01:00
Fabien Potencier 85e4ff9800 prepared the 1.15.0 release v1.15.0 2013-12-06 08:47:10 +01:00
Fabien Potencier fcecb284f0 fixed markup 2013-12-03 15:16:16 +01:00
Fabien Potencier 107fd201bf feature #1286 Adding ignoreStrictCheck option for call_user_func_array, if throwing exception (fabpot)
This PR was merged into the master branch.

Discussion
----------

Adding ignoreStrictCheck option for call_user_func_array, if throwing exception

Same as #1236 with added unit tests and C extension support (to come).

"I experienced the issue when using FuelPHP's ORM with EAV containers. When I tried to reference a property that was not defined I expected to get null, but instead the whole application stopped because an exception was thrown in the ORM, that no such function is present.

I couldn't find other possible exception that could be thrown when this function is called, so I assumed it's safe to take the ignoreStrictCheck into consideration here."

Commits
-------

1abf5d9 [ext] Mirroring PHP change for call_user_func_array, see #1286
9ab290b added tests for exceptions thrown in __call()
c711d37 Adding ignoreStrictCheck option for call_user_func_array, if throwing exception
2013-12-03 15:08:30 +01:00
Tugdual Saunier 1abf5d99fa [ext] Mirroring PHP change for call_user_func_array, see #1286 2013-12-03 15:03:12 +01:00
Fabien Potencier 9ab290bdb2 added tests for exceptions thrown in __call() 2013-12-03 14:14:58 +01:00
Fabien Potencier 7e7818e48f feature #1277 Added min and max function (lyrixx)
This PR was merged into the master branch.

Discussion
----------

Added min and max function

usefull for pagination

Commits
-------

6aa06de Added min and max function
2013-12-03 14:05:12 +01:00
Barta Tamás c711d37f1d Adding ignoreStrictCheck option for call_user_func_array, if throwing exception 2013-12-03 13:58:06 +01:00
Grégoire Pineau 6aa06dea05 Added min and max function 2013-12-03 13:46:57 +01:00
Fabien Potencier c9eca3508c fixed typo 2013-12-03 13:41:51 +01:00
Fabien Potencier 1747c337cb minor #1285 Corrected description of the "//" operator (ureimers)
This PR was merged into the master branch.

Discussion
----------

Corrected description of the "//" operator

The operator was previously described to truncate the the value when it in fact floors the result of the division (which can be seen in https://github.com/fabpot/Twig/blob/master/lib/Twig/Node/Expression/Binary/FloorDiv.php#L20).
By the old description one would think that ``{{ -20 // 7 }}`` would yield -2 (as in ``(int)(-20/7)``) when it actually returns -3 (as in ``floor(-20/7)``). Floor is not truncate (cast to int).

Commits
-------

a360bc0 Corrected description of the "//" operator
2013-12-03 13:41:40 +01:00
Fabien Potencier 697568bca2 fixed phpdoc 2013-12-03 13:38:38 +01:00
Fabien Potencier 05273c1502 feature #1261 added TokenStream::nextIf() (fabpot)
This PR was merged into the master branch.

Discussion
----------

added TokenStream::nextIf()

The introduction of `nextIf()` simplified a lot of code.

Commits
-------

0ed7898 added TokenStream::nextIf()
2013-12-03 13:29:21 +01:00
Fabien Potencier 0ed7898089 added TokenStream::nextIf() 2013-12-03 13:28:58 +01:00
ureimers a360bc037c Corrected description of the "//" operator
The operator was previously described to truncate the the value when it in fact floors the result of the division (which can be seen in https://github.com/fabpot/Twig/blob/master/lib/Twig/Node/Expression/Binary/FloorDiv.php#L20).
By the old description one would think that ``{{ -20 // 7 }}`` would yield -2 (as in ``(int)(-20/7)``) when it actually returns -3 (as in ``floor(-20/7)``). Floor is not truncate (cast to int).
2013-12-03 12:55:12 +01:00
Fabien Potencier cab9fd9a10 minor #1280 [Docs] Fix typos (bicpi)
This PR was merged into the master branch.

Discussion
----------

[Docs] Fix typos

Commits
-------

6ea9d8f [Docs] Fix typos
2013-11-24 19:36:20 +01:00
Philipp Rieber 6ea9d8f17d [Docs] Fix typos 2013-11-24 06:39:33 +01:00
Fabien Potencier f7c00d336f feature #1255 added the round filter (fabpot)
This PR was merged into the master branch.

Discussion
----------

added the round filter

fixes #1238

Commits
-------

ff4a7d2 added the round filter
2013-11-23 22:24:07 +01:00
Fabien Potencier 65880a7877 minor #1279 [Docs] Some minor fixes: Typos, Notations, Formatting (bicpi)
This PR was merged into the master branch.

Discussion
----------

[Docs] Some minor fixes: Typos, Notations, Formatting

Fixes for:
* Notations: html > HTML; javascript > JavaScript; composer > Composer
* Typos
* Wrong function names: ``escaper`` > ``escape``; ``include`` > ``source`` (in new chapter about ``source``)
* Formatting issues, e.g. remove RST from code blocks, it's not evaluated
* Wording where code sample outputs something: returns > outputs
* ``true`` parameter for ``autoescape`` - not needed any more

Commits
-------

a21df95 [Docs] Some minor fixes: Typos, Notations
2013-11-23 22:23:01 +01:00
Philipp Rieber a21df952ab [Docs] Some minor fixes: Typos, Notations 2013-11-23 21:51:26 +01:00
Fabien Potencier 39eb50c00e fixed optimizer max value 2013-11-14 09:08:49 +01:00
Fabien Potencier 2d012c4a4a minor #1270 Use string instead of large integer (ptarjan)
This PR was merged into the master branch.

Discussion
----------

Use string instead of large integer

HHVM differs from php-src on large integer parsing (php-src converts
them to floats, HHVM truncates them but leaves them as integers). The
point of this test is to make sure Twig parses it correctly, not the
underlying PHP execution engine.

Commits
-------

d401717 Use string instead of large integer
2013-11-13 09:11:09 +01:00
ptarjan d40171701f Use string instead of large integer
HHVM differs from php-src on large integer parsing (php-src converts
them to floats, HHVM truncates them but leaves them as integers). The
point of this test is to make sure Twig parses it correctly, not the
underlying PHP execution engine.
2013-11-12 23:38:46 -08:00
Fabien Potencier 8f7bea047e minor #1269 various cleanups (cordoval)
This PR was squashed before being merged into the master branch (closes #1269).

Discussion
----------

various cleanups

fix bool -> Boolean for consistency in other parts of twig's code removing
assignment to n as it is never used fix typo and docblock for consistency
remove line break not needed for consistency fix array docblock for
consistency

Commits
-------

cb651e8 various cleanups
2013-11-12 18:59:00 +01:00
Luis Cordova cb651e8ebb various cleanups 2013-11-12 18:58:59 +01:00
Fabien Potencier ff4a7d29ac added the round filter 2013-11-12 08:49:56 +01:00