I am using a single codeigniter installation to host 2 applications. But my problem is to share the same menu at the top of the page for both application. With my actual files structure, I don't know how to have the same header or menu for both application. Here is my actual structure :
system
application
--base_loisirs (folder application of base loisirs)
base_loisir.php (with $application_folder = 'application/base_loisirs';)
--parc_auto (folder application of parc auto)
parc_auto.php (with $application_folder = 'application/parc_auto';)
The folder application contain all the folders of different folders application. Is it possible for me in the base loisir view for example, to include a layout included in the par auto folder or vice versa ? How ?
Create one menu.php on root folder
Now create one directory name 'common' in view folder in both applications
/application
/view
/common ( new directory )
Now create another menu.php in common directory and put following code
require($_SERVER['DOCUMENT_ROOT'].'/menu.php');
Now load menu in any file of view using following code
<?php echo $this->load->view('common/menu', '', TRUE);?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With