Commit Graph

500 Commits

Author SHA1 Message Date
Hugo Hamon 953a0ce602 [doc] fixed Composer section of the introduction. Added a side note to the Composer official documentation for getting more information. 2012-05-28 08:30:24 +02:00
Fabien Potencier 843e1f74ee added an example for the loop variable (closes #732) 2012-05-23 07:40:44 +02:00
Tobias Schultze b6922682b0 removed leftover of 93c4406f8 and made some language improvements 2012-05-17 00:21:17 +03:00
Fabien Potencier 93c4406f87 fixed typos in the doc (closes #726) 2012-05-16 16:24:38 +02:00
literal d13f7424eb fix example in doc for embed tag 2012-05-10 14:33:17 +03:00
literal b11412efd8 improve documentation for embed tag 2012-05-10 03:10:48 +03:00
Fabien Potencier 1dc3c4beaf added documentation for the bitwise operators (closes #707) 2012-05-08 08:32:32 +02:00
Fabien Potencier 4cd98e62d0 clarified usage of the dump function (closes #718) 2012-05-08 08:23:16 +02:00
Fabien Potencier 5923f0cbad fixed markup in the doc 2012-04-27 17:50:30 +02:00
Fabien Potencier db8a109495 merged two doc files 2012-04-27 17:50:30 +02:00
Fabien Potencier bbfc7d7aef renamed a doc file 2012-04-27 17:50:27 +02:00
Fabien Potencier 50c511849f refactored the hacking twig doc chapter 2012-04-27 17:35:26 +02:00
Fabien Potencier 2a2aeee8e0 tweaked doc 2012-04-27 14:21:26 +02:00
Fabien Potencier 3697ef4a3e added a new recipe 2012-04-27 14:18:22 +02:00
Fabien Potencier 75d97b4a27 made the autoescape tag argument optional (defaults to 'html') 2012-04-25 18:22:58 +02:00
Fabien Potencier 73136d3583 added a note about auto-escaping and the embed tag
We cannot use the parent template to guess the auto-escaping strategy
either as it can be any valid expression, for which we have the real
value only at runtime (auto-escaping happening at compilation time).
2012-04-25 10:34:24 +02:00
Fabien Potencier d458e8c892 tweaked doc for the escape filter 2012-04-25 07:35:12 +02:00
Fabien Potencier 9ecf090ae8 simplified usage of the autoescape tag; the only argument is now the escaping strategy or false 2012-04-25 07:30:52 +02:00
Fabien Potencier 109db731ca changed the autoescape option to also accept a supported escaping strategy (for BC, true is equivalent to html) 2012-04-25 07:12:34 +02:00
Fabien Potencier 02f1c567b9 fixed markup in the doc 2012-04-24 13:12:09 +02:00
Fabien Potencier 0f623a1112 added the parent as an argument to the embed tag (removes the need to use extends) 2012-04-24 08:31:52 +02:00
Fabien Potencier fab21d8a76 renamed the inline tag to embed 2012-04-24 07:35:39 +02:00
Fabien Potencier 1b547807d2 tweaked examples 2012-04-23 21:26:07 +02:00
Fabien Potencier 955726a4a7 changed the inline examples to not use even/odd to avoid confustion 2012-04-23 21:23:37 +02:00
Fabien Potencier fafde80874 added more info in the docs 2012-04-23 20:08:03 +02:00
Fabien Potencier 2fa8224be4 added the inline tag 2012-04-23 19:39:43 +02:00
Fabien Potencier 07a953e016 tweaked the iterable example in the docs 2012-04-21 15:46:26 +02:00
Fabien Potencier fa0b0985c3 tweaked the iterable example in the docs 2012-04-21 07:33:50 +02:00
Fabien Potencier efcd8c5f25 fixed doc 2012-04-20 20:14:01 +02:00
Fabien Potencier b20a74868b removed the array test and rename the traversable test to iterable 2012-04-20 20:12:41 +02:00
Fabien Potencier da9d2eb834 merged branch Seldaek/isarray (PR #700)
Commits
-------

c88f8e5 Micro-optimizations
70cca66 Simplify code
d78ed66 Add traversable test
5fd2f98 Add docs
b2e1675 Add is array test

Discussion
----------

is array/traversable tests

It's sometimes necessary to display arbitrary data to be able to know if we should recurse or not.

---------------------------------------------------------------------------

by stof at 2012-04-13T12:13:11Z

I'm not sure about the need for ``is array``. All Twig functions related to arrays also support traversable objects

---------------------------------------------------------------------------

by Seldaek at 2012-04-13T12:23:32Z

Well, I like to have both for explicitness and also because I would try is array without looking at the docs, and I don't think it's right to make is array return true for traversables.

---------------------------------------------------------------------------

by fabpot at 2012-04-20T09:38:33Z

One of the main goal of Twig is to abstract the "real" type of the variables. We have already discussed the introduction of many tests like these ones and I have always rejected them.

As many people seems to have a need for them (especially for arrays), I would consider adding the `traversable` test. But as @stof said, Twig tries to blur the difference between traversable objects and arrays, so I'm -1 for adding another test for arrays.

`traversable` is probably not the best name for web designers but I don't know what else we can use here.

---------------------------------------------------------------------------

by stof at 2012-04-20T09:41:05Z

In Jinja, there is a built-in test for this using ``iterable``: http://jinja.pocoo.org/docs/templates/#builtin-tests

---------------------------------------------------------------------------

by Seldaek at 2012-04-20T09:41:32Z

Ok. I can live with dropping the array test. Now for the name,  `is forloopable`? I am kind of at a loss as well apart from traversable. I think if it's clearly mentioned in the docs it's ok.

---------------------------------------------------------------------------

by Seldaek at 2012-04-20T09:52:12Z

iterable sounds ok to me, but just as confusing as traversable I guess to the unknowing. A sidenote, if I update the PR, any objection to adding the "undefined" test as well?

---------------------------------------------------------------------------

by fabpot at 2012-04-20T10:01:27Z

Let's use `iterable` as this is what Jinja already uses. Why would you want an `undefined` test as we already have `defined`? (`if foo is not defined` works well enough)

---------------------------------------------------------------------------

by Seldaek at 2012-04-20T11:16:26Z

I just saw jinja had it on that page, and I thought why not add it too? Still not a huge fan of the "not" for negation.

---------------------------------------------------------------------------

by fabpot at 2012-04-20T12:18:17Z

Well, let's first finish the `iterable` test first and let's discuss `undefined` in another PR or issue.

---------------------------------------------------------------------------

by fabpot at 2012-04-20T17:10:28Z

I can finish the PR is you want.

---------------------------------------------------------------------------

by Seldaek at 2012-04-20T17:13:11Z

If you like sure, it's mostly deleting code anyway. I just have to finish some work stuff now..
2012-04-20 20:09:05 +02:00
Fabien Potencier 037f86aa55 added a note in the documentation about what the C exension does 2012-04-18 07:19:25 +02:00
Jordi Boggiano d78ed667ad Add traversable test 2012-04-13 13:05:17 +02:00
Jordi Boggiano 5fd2f98720 Add docs 2012-04-13 12:58:41 +02:00
Fabien Potencier fe3c17f51f added a tip in the doc 2012-04-08 12:58:26 +02:00
Igor Wiedler 11d4c6af6a [doc] Remove backticks in intro doc 2012-04-07 18:38:17 +03:00
mark_story 2a7102d059 Update docs concerning loop.last. 2012-04-07 09:50:44 -04:00
Fabien Potencier fbacbe60ad added some more information about unknown variable/attributes in the doc (closes #685) 2012-04-05 22:53:39 +02:00
Fabien Potencier b19ef8ea16 fixed doc markup 2012-04-03 09:10:53 +02:00
Fabien Potencier 81807ea95b fixed doc markup 2012-04-03 09:08:32 +02:00
Fabien Potencier 53e89ef2eb fixed doc indexes 2012-04-03 09:07:53 +02:00
Fabien Potencier 8656bd2afe added doc for the sandbox tag 2012-04-03 08:38:32 +02:00
Fabien Potencier 7ea15600ee added a note about sandbox policy checks in the doc (refs #677) 2012-04-03 07:32:06 +02:00
cb bf0cc537e3 Added code snippet to documentation to describe handling null values with date filter 2012-03-22 13:12:09 -05:00
Fabien Potencier a4fa6db03b added documentation for the trim filter 2012-03-22 14:34:27 +01:00
Raul Fraile 0519419bfd Updated 'convert_encoding' filter documentation 2012-03-13 17:33:49 +01:00
Fabien Potencier 9f322ab2fd fixed typo 2012-03-01 15:11:11 +01:00
Fabien Potencier e765183c62 fixed previous commit 2012-02-29 22:20:34 +01:00
Fabien Potencier a64a98431f merged branch robo47/docs-install-via-composer (PR #648)
Commits
-------

7153ff6 Installing twig via composer

Discussion
----------

Installing twig via composer

Installing twig via composer
2012-02-29 22:18:38 +01:00
Fabien Potencier 75b954c183 fixed typo in the doc 2012-02-29 22:02:48 +01:00