We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Volt 3.0.x - nested blocks

Is there a plan to implement nested blocks for the latest brach of Phalcon? If so may we get an estimated timeline?:]

What you mean by nested blocks ? For sure not 3.0.x, 3.0.x is onl for bug fixes etc.

edited Aug '16

I'm thinking about this:

{# base.volt #}
{% block panel %}
    <div class="panel">
        <div class="panel-heading">
            {% block panel_heading %}
                <h1>title</h1>
            {% endblock %}
        </div>
        <div class="panel-body">
            {% block panel_body %}
                <p>{{ content() }}</p>
            {% endblock %}
        </div>
    </div>
{% endblock %}
{% extends 'base.volt' %}
{% block panel_heading %}
<h2>title</h2>
{% endblock %}

Phalcon\Mvc\View\Exception with message Embedding blocks into other blocks is not supported

Github issue: https://github.com/phalcon/cphalcon/issues/329

There was a roadmap on phalcon blog at one time which had said it was planned to be implemented in the 2.x branch, but I cant find the link.

Is there any barrier to implement it beside the volt engine? If not, I might start meddling with it, cause we really need it in our project... :] (I presume it won't be easy either way, otherwise we would already have it)

edited Aug '16

Well, im guessing the barrier is that volt parser is written in c :D Then if you know c then go for it :D

Crap, I thought it's pure Zephir :( Well... that only makes it more challenging :DD

Just a theoretical question; after editing the C files in ext/phalcon/mvc/view/engine/volt, do I need to compile the parser seperately, or does the (zephir) build process link those files too?

edited Aug '16

I have no idea to be honest :) You only need to edit .c files not .zep.c

If you change source code, you should compile it then (like regular when you install Phalcon). The compilation process will take into account all the files, both changed and not changed, it doesn't really matter for compiler. :)