Multiple Views

hi guys how can I call multiple views in a controller method?

For example we have a header, body, footer view



404

You can integrate another view into your volt template http://docs.phalconphp.com/en/latest/reference/volt.html#view-integration For header and footer it's better to include them in views/index.volt, as they are common for all pages. For example (index.volt):

{{ partial('shared/header') }} {{ content() }} {{ partial('shared/footer') }}



7.0k

Thank you Andrey

where to put content

please help me to get a link for a dunamic website creation



33.9k

You can use blocks. In your index.volt :

<html>
    <body>
        {% block page_header %}{% endblock %}
        {% block page_body %}{% endblock %}
        {% block page_footer %}{% endblock %}
    </body>
</html>

Then, in edit.volt for example:

{% extends 'index.volt' %}

{% block page_header %}
    Page header
{% endblock %}

{% block page_body %}
    Page content
{% endblock %}

{% block page_footer %}
    Page footer
{% endblock %}