Commit Graph

93 Commits

Author SHA1 Message Date
Fabien Potencier 050fdf54b8 Merge branch '2.x' into 3.x
* 2.x:
  Update api.rst
  Fix typo
  Fix typos
  Fix CI on PHP5
2020-04-24 08:31:57 +02:00
Pierre Grimaud 0273057622 Fix typos 2020-04-24 08:22:30 +02:00
fancyweb e6d3402c71 Remove versionadded in 2.x in 3.x doc 2020-01-11 12:38:48 +01:00
Fabien Potencier ab735c7a1d Merge branch '2.x' into 3.x
* 2.x:
  Move country_timezone to a function
  Renamed inky to inky_to_html
  Minor fix in a filter description
  Minor fixes in the docs of some intl filters
2019-09-07 14:46:43 +02:00
Fabien Potencier c046e69e67 Move country_timezone to a function 2019-09-07 08:58:31 +02:00
Fabien Potencier d706fc259d Merge branch '2.x' into 3.x
* 2.x:
  added the cssinliner and inky extensions
  tweaked doc
2019-08-11 12:21:19 +02:00
Fabien Potencier 499a6eeb13 tweaked doc 2019-08-11 11:46:30 +02:00
Fabien Potencier 5b1f41b855 Merge branch '2.x' into 3.x
* 2.x:
  fixed markup in docs
  fixed markup in docs
  fixed typo
  fixed CS
  fixed typo
2019-08-10 16:16:55 +02:00
Fabien Potencier 5168c0e2fe fixed markup in docs 2019-08-10 16:16:47 +02:00
Fabien Potencier c4279abb1f Merge branch '2.x' into 3.x
* 2.x:
  disabled some tests that are not compatible with pHp 7.4 yet
  fixed typos
2019-08-10 15:49:59 +02:00
Fabien Potencier 3d5d053238 fixed typos 2019-08-10 15:14:08 +02:00
Fabien Potencier 6d14d9c9db Merge branch '2.x' into 3.x
* 2.x:
  fixed HTML extension
2019-08-10 11:13:02 +02:00
Fabien Potencier 5cc40a06f1 fixed HTML extension 2019-08-10 11:07:38 +02:00
Fabien Potencier 41ab8b9699 Merge branch '2.x' into 3.x
* 2.x:
  moved the HTML extension to an external Composer package
2019-08-10 07:48:25 +02:00
Fabien Potencier 59bb9d1033 moved the HTML extension to an external Composer package 2019-08-08 18:10:45 +02:00
Fabien Potencier 52c633a7be Merge branch '2.x' into 3.x
* 2.x:
  fixed the "empty" test on Traversable instances
  avoid confusion between .. and ..
  fixed phpdocs
  fixed CHANGELOG
  moved css_class function to html_classes filter
  Added support for `css_class` function
  added missing docs
  fixed wrong registration
  added the data_uri filter
  bumped version
  Update CoreExtension.php
2019-08-07 17:09:29 +02:00
Fabien Potencier 6ce9beb9fd moved css_class function to html_classes filter 2019-08-07 16:09:15 +02:00
Grégoire Pineau 2200d837ef Added support for css_class function 2019-08-07 15:57:33 +02:00
Fabien Potencier 8d86ddeb1a Merge branch '2.x' into 3.x
* 2.x:
  fixed doc format
  tweaked doc markup
  tweaked escape docs
2019-04-25 14:28:32 +02:00
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 682a27192b updated the docs for 3.0 2019-04-23 16:39:10 +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