#1
Hello all,
When I was using the below query in templates/views/admin_files/left_menu.php

I am getting this error

So is there any way to write queries directly in this path?
templates/views/admin_files/left_menu.php
Thanks in advance
Siri K
#2
Hello,
First, are you using this query in the view file called left-menu.php?
If so, you should not use query in a view. Use Query Bind.

$sub_menu = "SELECT * FROM sub_menu ";
Second, Where is sub_menu module located?

$sub_menu_res = $this->model->query($sub_menu, 'array'));

Dan
#3
Hi,
sub menu is not a separate module. Based on the user access permission I am trying to display the left menu in the administration area. for example, if I have a Dashboard, Events, and HR Management as a left menu, based on user permission, I would like to display the related menu on the left side. If user Ajay has access to only Dashboard and Events then I would like to show only Dashboard and Events in the left side menu. That is why I am trying to write a direct query in the left_menu.php file from the Template folder.
#4
Ok, You are trying to populate the dynamic_nav.php file.
Below is an example of what is in the file.


Your file is left_menu.php
Put an if statement, using roles ( admin, manager )
Then display the proper menu

and
Dashboard and Events


You could also put this in a if statement, using roles ( admin, manager, employee )
Dan