Phpurl pseudo-static parsing 1. do you want to talk about URL ing ?? Generally, there are two methods for url Ing. one is implemented through mod_rewrite. I will not talk about this online course material much more. Another method is to simulate in the program, such as the method in zendFramework,/index. php/controller/acti php url pseudo-static parsing.
1. let's talk about URL ING.
? ? Generally, there are two methods for url Ing. one is implemented through mod_rewrite. I will not talk about this online course material much more. Another method is to simulate it in a program, such as the method in zend Framework,/index. php/controller/action/var1/value1/var2/value2 /. The formula here is mainly to use a unified input interface, parse the url, and finally forward it to the module in the corresponding controller.
? ? I have written two simple functions here for simulation.
? ? The first function is mainly to parse the address, and put something similar to/index. the address of php/controller/action/var1/value1/var2/value2/is parsed into three parts: controller, module, and params.
Here we will complete the main url parsing function, and then forward Ing. the following function implementation (note that the implementation of this function is based on my own architecture, so you need to modify it accordingly. of course, if your MVC is similar to the zend Framework, you should not need much .)
_ SetParam ($ router ['params']); $ controller-> {$ router ['action']. 'action'} (); return true ;}?>