CI framework about navigation bar switching page

Source: Internet
Author: User
Tags php template
The environment has designed the following content in the navigation bar navbar. A simple design idea is: click the button above (such as aboutblog) and maincontainer loads the front-end page from the background. the original design idea used the CodeIgniter framework, which was intended to be in the front...Environment

The following navigation bar is designed:

The content in navbar is the body content.

Requirement

A very simple design idea is: click the above button (such as about/blog), main container willFrom the backgroundLoad the front-end page.

Original design ideas

The CodeIgniter framework is used.AjaxBinds all buttons in the navigation bar, and each button triggers an ajax request. the backend writes a public function to process front-end ajax requests.$this->load->view('xxx')Reload the Main INER page and implement php modularization (header. js/footer. js.. etc ).

Problem

Because the container loaded each time is different, the static files used are as follows:css|javascript|imgLoading in different INER is different, so the header and footer templates cannot be unified. If all static resources are written in the php template, the page will inevitably becomeLoading time is too long.

I have thought of an alternative solution. each container adds the nav label to ensure that different static resources are loaded separately. However, it is complicated to maintain the code after molding, code duplication is not efficient.

Is there any better solution ??

Reply content:Environment

The following navigation bar is designed:

The content in navbar is the body content.

Requirement

A very simple design idea is: click the above button (such as about/blog), main container willFrom the backgroundLoad the front-end page.

Original design ideas

The CodeIgniter framework is used.AjaxBinds all buttons in the navigation bar, and each button triggers an ajax request. the backend writes a public function to process front-end ajax requests.$this->load->view('xxx')Reload the Main INER page and implement php modularization (header. js/footer. js.. etc ).

Problem

Because the container loaded each time is different, the static files used are as follows:css|javascript|imgLoading in different INER is different, so the header and footer templates cannot be unified. If all static resources are written in the php template, the page will inevitably becomeLoading time is too long.

I have thought of an alternative solution. each container adds the nav label to ensure that different static resources are loaded separately. However, it is complicated to maintain the code after molding, code duplication is not efficient.

Is there any better solution ??

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.