Background description:
1. In yii, there are the following Controller
class PayController extends Controller
{
public function actionIosCallback()
{
echo 'hello yii';
}
}
访问www.XXX.com/pay/ios-callback,则页面显示hello yii
2. In yaf, there are the following Controller
class PayController extends Yaf_Controller_Abstract{
public function actionIosCallback()
{
echo 'hello yaf';
}
}
访问www.XXX.com/pay/iosCallback,则页面显示hello yaf
Problem description:
3.Ask how yaf is compatible with yii and access www.XXX.com/pay/ios-callback, then the page will display hello yaf
Note: Currently, the solution that I can think of is to rewrite the URL in the Nginx layer, but I think it is not the best solution, so I only discuss the PHP layer implementation
After studying the YII source code, I finally found the rules for rewriting routing. The method is as follows
The implementation method is to introduce this rule into the routerShutdown of yaf, so that the routing rules can be rewritten to achieve the purpose of displaying hello yaf on the page when accessing www.XXX.com/pay/ios-callback