Commit Graph

787 Commits

Author SHA1 Message Date
Evgeniy Koval a07b5ea008 Update json_encode.rst 2019-03-28 15:54:38 +01:00
Michael Babker 57beae460b Add spaceless filter to the index 2019-03-25 13:16:17 -05:00
Fabien Potencier 04408cda3a tweaked docs for macro 2019-03-11 13:59:54 +01:00
Fabien Potencier 1da95371d1 minor #2870 document support for defining default argument values in the macro tag (olets)
This PR was merged into the 1.x branch.

Discussion
----------

document support for defining default argument values in the macro tag

The `macro` tag documentation reads

> Macros differ from native PHP functions in a few ways:
> - Default argument values are defined by using the default filter in the macro body

and provides the example

```twig
{% macro input(name, value, type, size) %}
    <input type="{{ type|default('text') }}" name="{{ name }}" value="{{ value|e }}" size="{{ size|default(20) }}" />
{% endmacro %}
```

The implication is that native PHP function-like default argument value definition is not supported.

v1.12 added support for

```twig
{% macro input1(name, value, type = 'text', size = 20) %}
    <input type="{{ type }}" name="{{ name }}" value="{{ value|e }}" size="{{ size }}" />
{% endmacro %}
```

This updates the documentation to cover both ways of defining default argument values.

Commits
-------

40c7553a document support for defining default argument values in the macro tag
2019-03-11 13:55:14 +01:00
Fabien Potencier 68bbf5eb85 added a note about the performance of the spaceless filter 2019-03-10 08:59:57 +01:00
Henry Bley-Vroman 40c7553a69 document support for defining default argument values in the macro tag 2019-03-08 09:01:54 -05:00
Fabien Potencier b823898ee1 added a spaceless filter 2019-03-07 10:18:51 +01:00
Fabien Potencier f16405f797 tweaked docs 2019-03-05 20:08:13 +01:00
Fabien Potencier 5a2c4f2220 feature #2698 Add max value to random function (SpacePossum)
This PR was merged into the 1.x branch.

Discussion
----------

Add max value to random function

Commits
-------

50b27061 Add max value to random function
2019-03-05 20:06:35 +01:00
Fabien Potencier eaa29417ba fixed doc markup 2019-03-05 11:07:38 +01:00
Nat Zimmermann 97d9dc0404 Encourage using prepared statements 2019-03-02 08:49:36 +01:00
Fabien Potencier ab02b24f91 improved the tag documentation 2019-02-26 18:57:58 +01:00
Fabien Potencier 4f9d21fbce fixed wrong version in docs 2019-02-25 09:38:34 +01:00
Fabien Potencier 571cf6e984 improved documentation on tags 2019-02-25 09:34:06 +01:00
SpacePossum 50b270613d Add max value to random function 2019-02-17 14:14:54 +01:00
Fabien Potencier 3632a46e82 moved to namespaced classes by default 2019-02-15 08:28:49 +01:00
Fabien Potencier db751d62d3 fixed some class names 2019-02-15 08:28:49 +01:00
Fabien Potencier 2d9024843f added some docs about the difference between the include tag and the include function 2019-02-13 09:34:17 +01:00
Lesik e773c8fc9c Fix typo 2019-01-15 08:54:07 +01:00
Fabien Potencier a4ebc27300 minor #2802 Add missing information in the precedence paragraph (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

Add missing information in the precedence paragraph

closes #2766
closes #2728
closes #2731

Commits
-------

fb511950 added missing information in the precedence paragraph
2019-01-12 02:59:44 +01:00
Fabien Potencier fb51195059 added missing information in the precedence paragraph 2019-01-12 02:55:55 +01:00
rosier c760d62a67 Add missing ] 2019-01-11 20:02:58 +01:00
Fabien Potencier a2c4253406 enabled short array notation in docs 2019-01-08 11:56:48 +01:00
Alexander Schranz 7266c9ade1 Added hint that the php c extension is only for php5 2018-12-16 22:09:22 +01:00
Fabien Potencier e3790ab03c tweaked previous merge 2018-12-16 12:04:48 +01:00
LavaSlider bf529d0a7a Enhances join filter for natural language join (i.e., \"A, B and C\") 2018-12-16 11:41:42 +01:00
Fabien Potencier f2b8e9acad fiwed internal link 2018-10-12 07:15:08 -07:00
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