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
assemble可以生成url
请问如何在controller中获得Yaf_Router对象?
php官网的例子是这样子的
$router = new Yaf_Router(); $route = new Yaf_Route_Map(); $router->addRoute("map", $route); var_dump($router->getRoute('map')->assemble( array( ':c' => 'foo_bar' ), array( 'tkey1' => 'tval1', 'tkey2' => 'tval2' ) ) ); $route = new Yaf_Route_Map(true, '_'); $router->addRoute("map", $route); var_dump($router->getRoute('map')->assemble( array( ':a' => 'foo_bar' ), array( 'tkey1' => 'tval1', 'tkey2' => 'tval2' ) ) );
在boostrap中创建路由,在controller中如何得到路由对象呢?
尝试1
routes.login.type="regex" routes.login.match="#^/user/login#" routes.login.route.controller=user routes.login.route.action=login
$application = Yaf\Application::app(); $router = $application->getDispatcher()->getRouter(); $url = $router->getRoute('login'); $url = $url->assemble( [ ':m' => '', ':c' => 'user', ':a' => 'login' ], [] ); echo $url;
错误:Error Msg:Reverse property is not a valid strin
The text was updated successfully, but these errors were encountered:
使用自带的静态路由吧 性能好https://github.com/letwang/HookPHP
Sorry, something went wrong.
No branches or pull requests
assemble可以生成url
请问如何在controller中获得Yaf_Router对象?
php官网的例子是这样子的
在boostrap中创建路由,在controller中如何得到路由对象呢?
尝试1
错误:Error Msg:Reverse property is not a valid strin
The text was updated successfully, but these errors were encountered: