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

Is there an example web application that uses partial views with access control (security plugin)

Few screens from my application has sections that needs to be shown to a certain group of users only, i am looking for an example application (like invo) that demonstrates how to build views composed of many small partial view fragments. thanks in advance.



43.9k
Accepted
answer
edited Jan '16

Hi,

Depending on how you set authorization, but it can be as simple as:


  {% if session.auth == "registred" %}

    {{ partial("user/userMenu") }}

  {% endif %}