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
Is there any way to directly use $this in templates/views/admin_files/left_menu.php
3 years ago
3 years ago
#1
3 years ago
#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
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 years ago
#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.
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.
3 years ago
#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
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