We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我的想法是这样的:在定义路由的时候添加一些其它额外的属性,然后在plugin中根据这些属性做一些检查操作。
route.ini: user_following.type="rewrite" user_following.match="/:username/following$" user_following.route.module=index user_following.route.controller=user user_following.route.action=following user_following.route.otherParam=test
根据上边的route.ini获取到 Yaf\Dispatcher::getInstance()->getRouter()->getRoute('user_following'):
Yaf\Route\Rewrite Object ( [_route:protected] => /:username/following$ [_default:protected] => Array ( [module] => index [controller] => user [action] => following [otherParam] => test ) [_verify:protected] => Array ( [module] => index [controller] => user [action] => following [otherParam] => test ) )
然而"otherParam"也像“m c a”被定义成protected了,所以目前是访问不到的。
所以目前的解决方法只能通过扩展Yaf_Route_Rewrite添加getParam方法,但如果使用这种方法的话就不能使用Yaf_Config::addConfig( Yaf_Config_Abstract $routes_config )来配置路由了。
The text was updated successfully, but these errors were encountered:
问题解决了吧?最好使用静态路由
Sorry, something went wrong.
No branches or pull requests
我的想法是这样的:在定义路由的时候添加一些其它额外的属性,然后在plugin中根据这些属性做一些检查操作。
route.ini:
user_following.type="rewrite"
user_following.match="/:username/following$"
user_following.route.module=index
user_following.route.controller=user
user_following.route.action=following
user_following.route.otherParam=test
根据上边的route.ini获取到 Yaf\Dispatcher::getInstance()->getRouter()->getRoute('user_following'):
然而"otherParam"也像“m c a”被定义成protected了,所以目前是访问不到的。
所以目前的解决方法只能通过扩展Yaf_Route_Rewrite添加getParam方法,但如果使用这种方法的话就不能使用Yaf_Config::addConfig( Yaf_Config_Abstract $routes_config )来配置路由了。
The text was updated successfully, but these errors were encountered: