I am currently creating a new application feature where in I want to dynamically change the values of page headers, page header titles, and breadcrumbs that are fetched from dat
I just figured out a way on how to do this. The key is to get the id of the menu name from the database and return it as a row and in the custom helper, just call the id of the menu name from the database. Here is how I did it:
Here is my model:
function get_page_menu_names($menu_id)
{
$this->db->select('menu_name');
$this->db->from('menu_master');
$this->db->where('menu_id', $menu_id);
$query = $this->db->get();
$menu_name_row = $query->row();
if(isset($menu_name_row))
{
return $menu_name_row->menu_name;
}
}
And here is how I called it from the helper that I wrote out:
$page_header_array['inventory_master_listing'] = array(
"breadcrumbs" => array(
array('title'=>'Home','url'=>base_url()),
array('title'=> $this->my_model_name->get_page_menu_names(1),'is_active'=>TRUE),
),
"page_title" => $this->my_model_name->get_page_menu_names(1),
"page_header_title" => $this->my_model_name->get_page_menu_names(1).' : '.$project_title
);