How to correctly insert a Bootstrap navbar into the Codeigniter view?

Asked

Viewed 85 times

1

I am learning Codeigniter and would like to know what or what are the correct ways to insert a navbar in my view taking into account that it will be inserted by all views present in the system.

My question is which directory to record the code of navbar and what to call it in view?

1 answer

2

You can create a file called "navbar.php", for example, and save it within "application/views/Commons" (the Commons directory must be created manually, as it does not exist).

When you want to call this navbar in a view, just use:

$this->load->view("commons/navbar");

At the position you want inside the view file.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.