Zend Framework template introduces CSS, JS and other file path problems under public path and methods of generating URLs on templates

Source: Internet
Author: User
Tags zend framework

The structure of the system, there are two modules are default and admin, also has and smarty integration. But there are two problems:
1. When the access address is Http://XXX.com/index, http://XXX.com/admin, the page display is normal, the accessible address is: http://XXX.com/default/, Http://XXX.com/default /index or Http://XXX.com/admin/index/index, the page appeared problem picture, CSS and JS are not loaded, and later through Google, Baidu, found to achieve the above access is normal, must be in the path to add BaseURL, I want to ask if there is any good way, do not add BaseURL in front of the above can also be able to access normal.
2. How the URL on this page is generated, just like thinkphp also has a U method that can generate a URL on the url,zendframework template is really not found, I hope you answer my question, here first thank you

Reply content:

The structure of the system, there are two modules are default and admin, also has and smarty integration. But there are two problems:
1. When the access address is Http://XXX.com/index, http://XXX.com/admin, the page display is normal, the accessible address is: http://XXX.com/default/, Http://XXX.com/default /index or Http://XXX.com/admin/index/index, the page appeared problem picture, CSS and JS are not loaded, and later through Google, Baidu, found to achieve the above access is normal, must be in the path to add BaseURL, I want to ask if there is any good way, do not add BaseURL in front of the above can also be able to access normal.
2. How the URL on this page is generated, just like thinkphp also has a U method that can generate a URL on the url,zendframework template is really not found, I hope you answer my question, here first thank you

You should look directly at the page's original code and see what the baseurl ultimately outputs.
If BaseURL is the full URL, there is no problem, but if there is a problem, then BaseURL may just be the relative path, which needs to be added in front.
src= "/< $baseUrl >/js/nav.js"

  • Related Article

    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.