You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[VOLT] Support for embedding blocks into other blocks #17145
With inheritance of multiple files like a.volt extends b.volt extends c.volt, I have to use embedding blocks. Otherwise there's no profit to use inheritance more than one nesting level.
At this moment, Phalcon 2 is missing some features from 1.x and still not stable enough for using in production. Why don't you fix this bug in Phalcon 1.3.3?
It seems, developers are focused only on 2.x branch and will not implement any new features in 1.3. Anyway, this wasn't implemented for 1.5 years so... You can use Twig if you need this feature.
today: Phalcon\Mvc\View\Exception: Embedding blocks into other blocks is not supported in section.volt on line 3
proposed: <html><body>
<main>Article</main>
<aside><h3>Help</h3><p>Related</p></aside>
</body></html>
Overriding only the inner block, only the outer one, or neither works, and super() works at every level.
Blocks inside if/for work as in Twig: the block is always defined, and the condition decides where it renders.
A block name defined twice in one template becomes an error. Today the last one wins silently.
Activity
xpundel commentedon Mar 3, 2013
The same question. Is there a plans to implement this feature?
xpundel commentedon Jul 4, 2013
Greetings!
Is there any plans to implement this feature?
breezewish commentedon Aug 23, 2013
Hi, is there any plans? I think this feature is important.
gianks commentedon Aug 28, 2013
+1
gsouf commentedon Sep 2, 2013
I upvote for the feature
Raistlfiren commentedon Oct 14, 2013
Agreed. It would be nice to have a block inside an if statement.
kvokov commentedon Oct 30, 2013
I think it's very useful feature. Waiting for this!
gsouf commentedon Oct 30, 2013
Actually this is why i'm using twig instead of volt
raisoblast commentedon Nov 14, 2013
+1 for this great feature
vladimmi commentedon Jan 14, 2014
Any improvements after almost a year? As for me, this is the most needed missing feature in Volt
redstrike commentedon Jul 19, 2014
At this moment, Phalcon 2 is missing some features from 1.x and still not stable enough for using in production. Why don't you fix this bug in Phalcon 1.3.3?
immortalx commentedon Sep 4, 2014
+1 to implement this feature in 1.3.x
vladimmi commentedon Sep 4, 2014
It seems, developers are focused only on 2.x branch and will not implement any new features in 1.3. Anyway, this wasn't implemented for 1.5 years so... You can use Twig if you need this feature.
gsouf commentedon Sep 4, 2014
@phalcon told
67 remaining items
[NFR volt] - split per feature: patch series and wave 1 ticket drafts
Izopi4a commentedon Oct 16, 2026
A proposal for this one, for v7: #NFR-07 (resolve inheritance on the AST).
With inheritance resolved on the AST before compiling, nested blocks need no new syntax. Blocks are collected by name at any depth, and every block node is replaced by its most derived definition. The parser side is a 12-line change in
base.c: it stops refusing a block whileblock_level > 0. That check is also what makes a block inside{% if %}fail today, sinceif/for/switchbump the same counter. Patch: https://github.com/Izopi4a/cphalcon/blob/nfr-volt/resources/rfc/volt/prototype/patches/01-nested-blocks.patchPrototyped on master (5.23.0), with the original case from this issue:
super()works at every level.if/forwork as in Twig: the block is always defined, and the condition decides where it renders.Examples E1/E2 with captured output: https://github.com/Izopi4a/cphalcon/blob/nfr-volt/resources/rfc/volt/examples.md. The tests are in https://github.com/Izopi4a/cphalcon/blob/nfr-volt/resources/rfc/volt/prototype/tests/Prototype/InheritanceTest.php, next to the same templates failing on the stock build in
tests/Today/InheritanceTodayTest.php.this needs to be approved first #17679