--TEST-- "defined" support for blocks --TEMPLATE-- {% extends 'parent' %} {% block icon %}icon{% endblock %} {% block body %} {{ parent() }} {{ block('foo') is defined ? 'ok' : 'ko' }} {{ block('footer') is defined ? 'ok' : 'ko' }} {{ block('icon') is defined ? 'ok' : 'ko' }} {{ block('block1') is defined ? 'ok' : 'ko' }} {%- embed 'embed' %} {% block content %}content{% endblock %} {% endembed %} {% endblock %} {% use 'blocks' %} --TEMPLATE(parent)-- {% block body %} {{ block('icon') is defined ? 'ok' : 'ko' -}} {% endblock %} {% block footer %}{% endblock %} --TEMPLATE(embed)-- {{ block('icon') is defined ? 'ok' : 'ko' }} {{ block('content') is defined ? 'ok' : 'ko' }} {{ block('block1') is defined ? 'ok' : 'ko' }} --TEMPLATE(blocks)-- {% block block1 %}{%endblock %} --DATA-- return [] --EXPECT-- ok ko ok ok ok ko ok ko
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
array.test | File | 336 B | 0644 |
|
constant.test | File | 388 B | 0644 |
|
defined.test | File | 2.95 KB | 0644 |
|
defined_for_attribute.test | File | 752 B | 0644 |
|
defined_for_blocks.test | File | 888 B | 0644 |
|
defined_for_blocks_with_template.test | File | 488 B | 0644 |
|
defined_for_constants.test | File | 388 B | 0644 |
|
defined_for_macros.test | File | 480 B | 0644 |
|
defined_on_complex_expr.test | File | 241 B | 0644 |
|
dynamic_test.test | File | 213 B | 0644 |
|
empty.test | File | 1.81 KB | 0644 |
|
even.test | File | 204 B | 0644 |
|
in.test | File | 2.08 KB | 0644 |
|
in_with_objects.test | File | 343 B | 0644 |
|
iterable.test | File | 345 B | 0644 |
|
null_coalesce.test | File | 452 B | 0644 |
|
null_coalesce_block.test | File | 158 B | 0644 |
|
odd.test | File | 126 B | 0644 |
|