Commit Graph

946 Commits

Author SHA1 Message Date
Fabien Potencier 86eb15dede removed the "base_template_class" option on Twig\Environment 2019-04-23 17:42:53 +02:00
Fabien Potencier 682a27192b updated the docs for 3.0 2019-04-23 16:39:10 +02:00
Fabien Potencier b4cbc2a774 Merge branch '1.x' into 2.x
* 1.x:
  tweaked macro docs
2019-04-23 09:03:33 +02:00
Fabien Potencier 7446a6d89f tweaked macro docs 2019-04-23 08:35:30 +02:00
Fabien Potencier 5558a954e5 Merge branch '1.x' into 2.x
* 1.x:
  added a note about escaping
  fixed doc (missing word)
2019-04-22 17:53:59 +02:00
Fabien Potencier 6e93c4d0c8 minor #2950 Add a note about escaping (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

Add a note about escaping

closes #2623, closes #2661

Commits
-------

a83f7e85 added a note about escaping
2019-04-22 09:08:02 +02:00
Fabien Potencier a83f7e855d added a note about escaping 2019-04-22 09:04:11 +02:00
Fabien Potencier 8e2f11d165 fixed doc (missing word) 2019-04-22 08:28:53 +02:00
Fabien Potencier 253f3e8e88 Merge branch '1.x' into 2.x
* 1.x:
  made escaping on ternary expressions more fine-grained
2019-04-11 21:10:58 +02:00
Fabien Potencier dfa9411310 made escaping on ternary expressions more fine-grained 2019-04-11 17:26:15 +02:00
Fabien Potencier cf98f334e8 Merge branch '1.x' into 2.x
* 1.x:
  added the possibility to give a nice name to string templates
  added the possibility to give a nice name to string templates
2019-04-11 09:58:10 +02:00
Fabien Potencier d7e2e5418c added the possibility to give a nice name to string templates 2019-04-11 09:55:43 +02:00
Fabien Potencier cef61a0cad Merge branch '1.x' into 2.x
* 1.x:
  added support for a new whitespace trimming option
  made Lexer regexes more readable
  simplified Lexer regexes
2019-04-03 16:42:51 +02:00
Fabien Potencier b01c0cd6db added some missing docs 2019-04-03 16:07:17 +02:00
Fabien Potencier 96eab472d6 added support for a new whitespace trimming option 2019-04-03 11:34:18 +02:00
Fabien Potencier e3470f5e4f Merge branch '1.x' into 2.x
* 1.x:
  Add Traversable support of length filter
  Update json_encode.rst
  Add spaceless filter to the index
  fix major version in Environment
  bumped version to 1.38.5-DEV
  prepared the 1.38.4 release
2019-04-02 17:21:06 +02:00
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
Hugo Alliaume aca6e2cd44 fix(with): comment some strings 2019-03-22 08:50:06 +01:00
Fabien Potencier d6df732a8b added a note about Environment::resolveTemplate in 3.0 2019-03-15 17:40:37 +01:00
Fabien Potencier b5da9b5aa7 deprecated passing a Twig\Template to load()/resolveTemplate() 2019-03-11 19:58:35 +01:00
Fabien Potencier a4476dfc78 updated docs 2019-03-11 19:58:35 +01:00
Fabien Potencier 4c3aaa5611 removed obsolete docs 2019-03-11 14:00:15 +01:00
Fabien Potencier dd96b16347 Merge branch '1.x' into 2.x
* 1.x:
  tweaked docs for macro
  document support for defining default argument values in the macro tag
2019-03-11 14:00:00 +01: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 a65a807afa Merge branch '1.x' into 2.x
* 1.x:
  added a note about the performance of the spaceless filter
2019-03-10 09:00:42 +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 64f7c02431 deprecated the spaceless tag 2019-03-07 11:02:32 +01:00
Fabien Potencier 65ea4c5296 Merge branch '1.x' into 2.x
* 1.x:
  Revert "re-implemented the spaceless tag to reuse the filter tag logic"
  fixed CS
  re-implemented the spaceless tag to reuse the filter tag logic
  added a spaceless filter
  removed unneeded usage of spaceless in tests
2019-03-07 10:59:18 +01:00
Fabien Potencier b823898ee1 added a spaceless filter 2019-03-07 10:18:51 +01:00
Fabien Potencier 2702126349 Merge branch '1.x' into 2.x
* 1.x:
  tweaked docs
  Add max value to random function
2019-03-05 20:11:37 +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 379f0c3553 added soe missing deprecations 2019-03-05 11:53:39 +01:00
Fabien Potencier 2d52000798 added missing deprecated entry in the docs 2019-03-05 11:12:33 +01:00
Fabien Potencier 5001301df9 Merge branch '1.x' into 2.x
* 1.x:
  fixed doc markup
2019-03-05 11:11:07 +01:00
Fabien Potencier eaa29417ba fixed doc markup 2019-03-05 11:07:38 +01:00
Fabien Potencier 84cb693f23 updated CHANGELOG 2019-03-05 10:32:09 +01:00
Fabien Potencier 5eb5ad9769 Merge branch '1.x' into 2.x
* 1.x:
  added getLoaders() on the chain loader
  Encourage using prepared statements
2019-03-03 20:50:09 +01:00
Nat Zimmermann 97d9dc0404 Encourage using prepared statements 2019-03-02 08:49:36 +01:00
Fabien Potencier 8e166f2dae Merge branch '1.x' into 2.x
* 1.x:
  improved the tag documentation
2019-02-27 08:39:53 +01:00
Fabien Potencier ab02b24f91 improved the tag documentation 2019-02-26 18:57:58 +01:00
Fabien Potencier 62a1c66397 removed mentions of version 1.x in docs for 2.x 2019-02-25 09:39:24 +01:00
Fabien Potencier b2883a9885 Merge branch '1.x' into 2.x
* 1.x:
  fixed wrong version in docs
2019-02-25 09:38:41 +01:00
Fabien Potencier 4f9d21fbce fixed wrong version in docs 2019-02-25 09:38:34 +01:00
Fabien Potencier 56cab7674c Merge branch '1.x' into 2.x
* 1.x:
  improved documentation on tags
2019-02-25 09:36:05 +01:00
Fabien Potencier 571cf6e984 improved documentation on tags 2019-02-25 09:34:06 +01:00
Fabien Potencier e00241546d minor #2851 Tweak some docs (fabpot)
This PR was merged into the 2.x branch.

Discussion
----------

Tweak some docs

Commits
-------

a12e79b6 tweaked some docs
2019-02-24 10:13:35 +01:00