73 Commits

Author SHA1 Message Date
Fabien Potencier 97167aab98 Merge branch '1.x' into 2.x
* 1.x:
  tweaked doc markup
  tweaked escape docs
2019-04-25 14:27:37 +02:00
Fabien Potencier fa836ddfea tweaked doc markup 2019-04-25 12:14:46 +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 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
SpacePossum 50b270613d Add max value to random function 2019-02-17 14:14:54 +01:00
Fabien Potencier 725f94233a used ::class whenever possible 2019-02-16 19:20:58 +01:00
Fabien Potencier ff77e221e0 Merge branch '1.x' into 2.x
* 1.x:
  moved to namespaced classes by default
  fixed some class names
  bumped version to 1.38
2019-02-15 08:34:23 +01:00
Fabien Potencier 3632a46e82 moved to namespaced classes by default 2019-02-15 08:28:49 +01:00
Fabien Potencier 2ed21eea43 Merge branch '1.x' into 2.x
* 1.x:
  fixed .php_cs CS
  removed 5.3 from Travis matrix
  removed array notation in comments
  enabled short array notation in docs
  fixed usage of short array notation in tests
  fixed usage of short array notation in tests
  fixed more short array notations
  switched to use PHP short array notation for Twig's code
  switched to use short arrays in generated code
  dropped PHP 5.3 support
  bumped version
2019-01-08 17:28:13 +01:00
Fabien Potencier a2c4253406 enabled short array notation in docs 2019-01-08 11:56:48 +01:00
Fabien Potencier 094c22c5fd Merge branch '1.x' into 2.x
* 1.x:
  use HTTPS whenever possible
2018-04-20 08:09:12 +02:00
Fabien Potencier 4f57c6eab8 use HTTPS whenever possible 2018-04-20 08:05:14 +02:00
Fabien Potencier 6019605609 Merge branch '1.x' into 2.x
* 1.x:
  Environment::resolveTemplate now accepts instances of TemplateWrapper
  Change typo in documentation
  fix grammar
2017-11-12 10:45:51 -08:00
Chris Wright d430989818 fix grammar 2017-11-12 10:24:45 -08:00
Fabien Potencier f03ddaef43 Merge branch '1.x' into 2.x
* 1.x:
  added more final classes
  add a comma to clarify the meaning
2016-12-23 09:06:20 +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 b7a5597f09 Merge branch '1.x' into 2.x
* 1.x:
  tweaked a deprecation notice
  added more docs about the range function
2016-12-23 07:53:11 +01:00
Fabien Potencier 40348480e7 added more docs about the range function 2016-12-23 07:21:48 +01:00
Fabien Potencier 183f062bbf removed obsolete code 2016-11-15 17:01:14 -05:00
Fabien Potencier 5a7b20205d Merge branch '1.x' into 2.x
* 1.x:
  exposed a way to access template data and methods in a portable way
  removed optimization as it's not compatible with Symfony cache system
2016-11-15 16:57:15 -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 4c39e930cd remove obsolete docs 2016-11-12 18:12:38 -08:00
Fabien Potencier 26fefedbae Merge branch '1.x' into 2.x
* 1.x:
  updated CHANGELOG
  added with tag
  added missing docs
  added support for a custom template on the block() function
2016-11-12 18:11:17 -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
Fabien Potencier 05e1c68c4b Merge branch '1.x' into 2.x
* 1.x:
  added some more tests
  added 'is defined' support for constant
  added 'is defined' support for block()
  Add test to check if a block exists
2016-11-11 13:50:46 -08:00
Fabien Potencier c81bae489e added 'is defined' support for constant 2016-11-11 13:40:51 -08:00
Fabien Potencier 3ce06af6b4 added 'is defined' support for block() 2016-11-11 12:03:32 -08:00
Fabien Potencier 94586346be removed obsolete features 2016-09-28 10:49:38 -07:00
Fabien Potencier df9a1151ee Merge branch '1.x'
* 1.x:
  deprecated Twig_ExtensionInterface::getName()
  added some missing tests for functions/filters as static calls
  added missing information in deprecatd.rst
2016-09-28 10:45:26 -07:00
Fabien Potencier 71f03df011 deprecated Twig_ExtensionInterface::getName() 2016-09-28 10:05:09 -07:00
Fabien Potencier ff506eb9ab Merge branch '1.x'
* 1.x:
  fixed PHP 5.2 compat
  tweaked previous merge
  add ignore_missing agrument to source function
  updated CHANGELOG
2015-07-03 12:14:51 +02:00
Fabien Potencier 641090378d tweaked previous merge 2015-07-03 11:46:19 +02:00
Valeriy Trubachev afa93586bc add ignore_missing agrument to source function 2015-07-03 11:44:24 +02:00
Fabien Potencier 72cc7d8081 removed obsolete docs 2015-03-02 18:32:57 +01:00
Fabien Potencier 997f2f0823 fixed formatting in the docs 2014-10-11 01:31:53 +02:00
Brandon Kelly 2f5a927b72 date() documentation correction 2014-09-30 10:07:37 -07:00
Fabien Potencier 8e625ba57d minor #1336 Added additional example to min/max doc (c33s)
This PR was squashed before being merged into the 1.15-dev branch (closes #1336).

Discussion
----------

Added additional example to min/max doc

* fixed typo in the word "four"
* added an additional example with letters

Commits
-------

b709577 Added additional example to min/max doc
2014-02-24 16:39:24 +01:00
Julian b7095770e2 Added additional example to min/max doc 2014-02-24 16:39:24 +01:00
Fabien Potencier e9e4748475 added a note about how to check for dynamic attribute existence in the docs 2014-01-29 09:45:07 +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 fcecb284f0 fixed markup 2013-12-03 15:16:16 +01:00
Grégoire Pineau 6aa06dea05 Added min and max function 2013-12-03 13:46:57 +01:00
Philipp Rieber a21df952ab [Docs] Some minor fixes: Typos, Notations 2013-11-23 21:51:26 +01:00
Fabien Potencier dff7d2c758 added a source function to include the content of a template without rendering it 2013-10-31 13:38:11 +01:00
Fabien Potencier 25e7befa37 fixed CS in docs 2013-10-26 08:29:21 +02:00
Karl Horky 9b7322496e missing closing parenthesis 2013-10-17 10:00:32 +02:00