mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-13 19:06:40 +00:00
added a deprecation notice when using the spaceless tag
This commit is contained in:
@@ -30,6 +30,8 @@ final class SpacelessTokenParser extends AbstractTokenParser
|
||||
{
|
||||
public function parse(Token $token)
|
||||
{
|
||||
@trigger_error('The spaceless tag is deprecated since version 2.7, use the spaceless filter instead.', E_USER_DEPRECATED);
|
||||
|
||||
$lineno = $token->getLine();
|
||||
|
||||
$this->parser->getStream()->expect(/* Token::BLOCK_END_TYPE */ 3);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
capturing "block" tag
|
||||
--DEPRECATION--
|
||||
The spaceless tag is deprecated since version 2.7, use the spaceless filter instead.
|
||||
--TEMPLATE--
|
||||
{% set foo %}{% block foo %}FOO{% endblock %}{% endset %}
|
||||
{{ foo }}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
--TEST--
|
||||
"spaceless" tag in the root level of a child template
|
||||
--DEPRECATION--
|
||||
The spaceless tag is deprecated since version 2.7, use the spaceless filter instead.
|
||||
Using the spaceless tag at the root level of a child template in "index.twig" at line 3 is deprecated since Twig 2.5.0 and will become a syntax error in 3.0.
|
||||
Nesting a block definition under a non-capturing node in "index.twig" at line 4 is deprecated since Twig 2.5.0 and will become a syntax error in 3.0.
|
||||
--TEMPLATE--
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
"spaceless" tag removes whites between HTML tags
|
||||
--DEPRECATION--
|
||||
The spaceless tag is deprecated since version 2.7, use the spaceless filter instead.
|
||||
--TEMPLATE--
|
||||
{% spaceless %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user