I use PHP Phalcon and I'd like to implement two different menus. First for regular user and second for admin. I want to have two menu templates to expand menus easily.
Now I have something like this:
//Main template:
[...]
if (session->role == 'admin')
include 'adminmenu.volt'
elseif (session->role == 'user')
include 'usermenu.volt'
{{ get_content() }} //from upper templates
[...]
(Unlogged user doesn't have menu.)
I think this is not entirely correct. First of all i have no idea how to highlight active position. Secondly I'd like to control menu from controller, for example add special option by change something in database. Is there a proper way to do this? I'd like to get simple solution without using javascript, modules or microservices