In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "how to solve the url case problem in zend framework framework", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let Xiaobian take you to learn "How to solve the problem of url capitalization in zend framework"!
Users who have developed projects with Zend Framework know that Controller and Action names in Zend Framework (ZF) MVC do not support case by default, which is obviously unacceptable to developers who are used to hump code style. Fortunately, you can set the useCaseSensitiveActions parameter of FrontController to make Zend Framework support the naming of Controller and Action in case. The code is as follows:
The copy code is as follows:
$front = Zend_Controller_Front::getInstance();
$front->setParam('useCaseSensitiveActions',true);
Now if you define an Action in AppController called CoderBolgAction(); and to access this Action, write http://localhost/app/coder-bolg/in the URL, notice that the second capital letter of Action is preceded by '-'. That's okay, at least the problem is solved, and adding '-' doesn't affect SEO, and it's even more search engine friendly than humping. But there's an even more intolerable problem: URLs are case-sensitive. That is to say, if the user enters a letter of Action in capital in the URL, it will not be displayed. Dizzy... but this is also easier to solve. Before routing, modify ModuleName, ControllerName and ActionName to lowercase. I added these three lines to the init() method of the subclass of Zend_Controller_Action (in our project, let this subclass inherit Zend_Controller_Action, and our Controller inherit this class):
The copy code is as follows:
$this->_request->setModuleName( strtolower( $this->_request->getModuleName() ) );
$this->_request->setControllerName(strtolower($this->_request->getControllerName()));
$this->_request->setActionName( strtolower( $this->_request->getActionName() ) );
This solves the case-sensitive problem of URLs.
At this point, I believe that everyone has a deeper understanding of "how to solve the url case problem in the zend framework framework", so let's actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.