php – How to display dynamic data using custom templates and helpers in CodeIgniter?

I'm creating a feature in my application in which I want to dynamically change the text of page headers, page headers and breadcrumbs according to the ID and the menu name of the table in my database so that I do not code them manually whenever there is an update. I've already created a template and a custom wizard in CodeIgniter and loaded the template into the help using the $ CI = & get_instance but I'm not sure how to dynamically call the names of the database menu using the template I created in the custom help that I wrote. You will find below some of my codes in my template and the custom help I have created.

Model:

public service __construct ()
{
parent :: __ construct ();
}

function get_page_menu_names ($ menu name)
{
// $ this-> db-> where (& # 39; menu_id & # 39 ;, $ menu_id);

$ this-> db-> where ('menu name & # 39 ;, $ menu name);

$ query = $ this-> db-> get (& # 39; menu_master & # 39;);

return $ query-> result ();
}

Custom Helper that I created and called the model and its function:

__construct () function
{
parent :: __ construct ();
$ CI = & get_instance ();
$ CI-> load-> model (& # 39; Page_Header_model & # 39;);
$ CI-> Page_Header_model-> get_page_menu_names ();
}

get_page_header_data function ($ type_page)
{

$ project_title = & # 39; Test & # 39 ;;

$ page_header_array['dashboard'] = table (
"page_title" => & # 39; Dashboard & # 39;
"page_header_title" => & # 39; Dashboard: & # 39 ;. $ project_title

)

$ page_header_array['price_list'] = table (

"breadcrumbs" => table (
array (& # 39; title & # 39; => & # 39; home & # 39; url & # 39; => base_url ()),
array (& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & gt;
)
"page_title" => "Price List",
"page_header_title" => "Price list: & # 39; $ project_title

)

$ page_header_data = $ page_header_array[$page_type];

return $ page_header_data;
}