Commit Graph

810 Commits

Author SHA1 Message Date
Fabien Potencier d59dfc979b fixed ReST format 2018-10-12 05:53:19 -07:00
Peter Bowyer 7f4ecd66f1 Document combining JSON constants
Working out how to do this took Slack and StackOverflow. Documenting so others know what to do.
2018-10-12 05:51:35 -07:00
Javier Eguiluz f07a876de6 Improved the code of an example 2018-09-27 16:26:19 +02:00
Yonel Ceruto 2ab433833e Added "deprecated" tag 2018-07-31 08:18:50 -04:00
Fabien Potencier 4beb7bfb0b Add support for dynamic tests 2018-07-31 11:10:58 +02:00
Christian Flothmann 36787f01d2 fix a typo 2018-05-30 21:54:04 +02:00
Fabien Potencier f4c020923f fixed doc markup 2018-05-18 09:23:18 +02:00
ismael-miguel 22739e7d13 Added missing edge-cases
Discussion on: https://github.com/twigphp/Twig/issues/2677
2018-04-25 20:48:23 +01:00
Fabien Potencier 4f57c6eab8 use HTTPS whenever possible 2018-04-20 08:05:14 +02:00
Fabien Potencier e923101942 bug #2600 Be able to count on iterator (scuben)
This PR was merged into the 1.x branch.

Discussion
----------

Be able to count on iterator

This PR allows to count on `\Traversable` Objects. Not sure if I made the change to the correct branch. Tell me please if I should target 2.x or master.

Commits
-------

be2c32cc Be able to count on iterator
2018-01-30 17:11:48 +01:00
ARTACK WebLab be2c32cc1c Be able to count on iterator 2018-01-30 17:04:01 +01:00
Fabien Potencier f93530b440 made it clear that placeholders are free-forms for the replace filter 2018-01-30 08:01:42 +01:00
Peter Fisher b42fd6435e Update advanced.rst
I noticed that the rot13Provider wasn't called correctly as it was trying to access a local variable instead of calling $this
2017-12-07 07:56:46 -08:00
Chris Wright d430989818 fix grammar 2017-11-12 10:24:45 -08:00
Tobias Olry ef6c950505 show how to use a variable as hash map key 2017-08-02 20:11:29 +02:00
Steven Pribilinskiy b8967bd371 Update internals.rst
Missing an opening paren
2017-06-16 06:42:12 -07:00
simsim2006 54f0f7ae1c Create number_format.rst 2017-06-12 08:07:51 -07:00
Grégoire Pineau c0b5eb9f03 [Doc] Fixed documentation about 'Definition vs Runtime' 2017-06-02 16:26:53 +02:00
Fabien Potencier eb58c61536 reworded docs 2017-05-22 07:52:05 +02:00
DarkBee 40fdb9e3e5 Update number_format.rst 2017-05-22 07:50:40 +02:00
Fabien Potencier 75f2231a45 fixed code for older versions of PHP 2017-05-11 15:26:49 -07:00
Artem Genvald a264fc62e5 Fix typo in advanced.rst file 2017-05-05 06:59:56 -07:00
Matthias Pigulla f5193e92c5 Make "length" filter and "empty" test consider __toString [Twig 1.x] 2017-03-22 07:33:03 -07:00
Evaldo Junior 955d5abd92 Updated the vim-twig link
The other project is not maintained anymore and the author recommends this fork.
2017-03-12 08:19:54 -07:00
aaa2000 adba4c2a2b Fix codeblock 2017-03-10 08:51:30 -08:00
Fabien Potencier af0d787c43 fixed CS 2017-02-23 06:54:27 -08:00
Antony D'Andrea 7d8e75504c #1802 left/right trim 2017-02-23 06:52:03 -08:00
Fabien Potencier 236c1bdc32 added some missing tests 2017-02-21 18:49:28 -08:00
Fabien Potencier 7efe539b82 added a note in the docs about the PSR-11 runtime loader 2017-02-17 11:16:50 -08:00
Fabien Potencier d6715ac8c3 tweaked docs 2017-02-03 13:34:15 -08:00
Peter Potrowl 048f549017 Update striptags.rst 2017-02-03 13:32:21 -08:00
Fabien Potencier 73de309fb4 fixed CS 2017-02-03 13:30:43 -08:00
Stéphane Lavergne 70d03042df Mention autoescape=true deprecation (issue #2386) 2017-02-03 13:29:55 -08:00
Fabien Potencier c9a14464a3 added a note about macros usage in the deprecated docs 2017-01-11 11:20:42 -08:00
Jean pasqualini c8f69d764b Fix the argument name of filter replace
The argument name in the code is $from

See https://github.com/jean-pasqualini/Twig/blob/1.x/lib/Twig/Extension/Core.php#L475.

Issue : https://github.com/twigphp/Twig/issues/2329
2017-01-05 18:35:52 +01:00
Benjamin Paap ce90852541 Minor typo in class name 2016-12-29 22:21:24 +01:00
Christian Flothmann 7cd3c9d25f add a comma to clarify the meaning
Without the comma you could understand that the "if" not only applied
to `-1`, but to `1` as well if you read too quickly.
2016-12-23 08:52:50 +01:00
Fabien Potencier 40348480e7 added more docs about the range function 2016-12-23 07:21:48 +01:00
Fabien Potencier ed37fc72e1 minor #2290 Better testing of operators returned by Extension (SpacePossum)
This PR was merged into the 1.x branch.

Discussion
----------

Better testing of operators returned by Extension

Add better testing and docs description about operators when using an extension.

Commits
-------

282df53 Better type description on PHPDoc, better testing of returned value.
2016-12-13 10:48:03 +01:00
Fabien Potencier e89c712f58 marked some classes as being final 2016-12-10 08:40:37 +01:00
SpacePossum 282df533de Better type description on PHPDoc, better testing of returned value. 2016-12-09 08:12:45 +01:00
Fabien Potencier 8ab764b4d3 added support for {{ _self }} to provide an upgrade path from 1.x to 2.0 2016-12-08 08:54:19 +01:00
Fabien Potencier 629810c91e fixed doc issues 2016-11-18 10:07:48 -05:00
Fabien Potencier 9c9816874d fixed typo in the docs 2016-11-18 09:49:07 -05:00
Fabien Potencier d7062f35b8 exposed a way to access template data and methods in a portable way 2016-11-12 19:45:39 -08:00
Fabien Potencier aa2ca14e88 feature #2246 Add a "with" tag (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

Add a "with" tag

Closes #719, alternative implementation of #1054

Commits
-------

4366907 added with tag
2016-11-12 17:41:49 -08:00
Fabien Potencier 4366907d73 added with tag 2016-11-12 17:40:47 -08:00
Fabien Potencier 02b084e2f5 feature #2245 added support for a custom template on the block() function (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

added support for a custom template on the block() function

`block()` allows one to render a block of the current template.

This PR adds the possibility to use `block()` to render a block of another template:

```twig
{{ block('footer', template_name) }}
```

As it uses the same logic as for the regular `block()`, you can also use it in a test:

```twig
{% if block('footer', template_name) is defined %}
    ...
{% endif %}
```

This removes the needs to use the internal `Twig_Template::renderBlock()` method in the Symfony Web Profiler for instance. And combined with #2236, it allows us to really mark the whole `Twig_Template` class as being internal.

I'm aware that #1302 asked for being able to pass a context to `block()` (implemented in #1433), but I prefer not to in favor of adding the `with` tag (see #719 and #1054).

When the `with` will be implemented, the code in the Symfony Web Profiler will become something along the lines of:

```twig
        {% with {
            'collector': profile.getcollector(name),
            'profiler_url': profiler_url,
            'token': profile.token,
            'name': name
          } %}
            {{ block('toolbar', template) }}
        {% endwith %}
```

Commits
-------

5ed59be added support for a custom template on the block() function
2016-11-12 17:38:59 -08:00
Fabien Potencier 065b2e26a2 added missing docs 2016-11-12 17:36:55 -08:00
Fabien Potencier 5ed59be9c5 added support for a custom template on the block() function 2016-11-12 17:34:29 -08:00