Hi,
right now I’m working on a website using CodeIgniter as its PHP Framework. I use AJAX to load content into the main page, when an user click one of the navigation link of my website. My aim is that the user won’t have to wait to reload the whole layout, but just partially, specifically only the content div. The link that are clicked will be processed by AJAX to a controller.
I want this controller then process the link and sent back the data to the main page.
For example, in my views folder I have a page ‘Background’ which is under the ‘About Us’ folder.
Normally to load this page by CodeIgniter will need the user to type: “http://www.example.com/aboutus/background”
aboutus is my controller which has a background as its function and will load the page ‘Background’ in the views folder.
Now I want that the link will be: “http://www.example.com/#/aboutus/background”, the hash will be needed for my AJAX request.
My controller will receive only /aboutus/background from the AJAX and I want that my controller then will pull the ‘background’ Function from the ‘aboutus’ Controller, how do I achieve this? How do I build the code that will call function from another controller?