zend-framework - Zend 框架 : Checking if route exists from code

标签 zend-framework routes

在 zend 框架中,我是否可以通过代码检查路由是否存在?

示例

假设以下路由/url 有效(指向 Controller /操作)

/users
/users/1 // /users?id=1
/users/page/1  /users?page=1
/users/tagged/tagname/page/1 /users?tagged=1&page=1

如果用户尝试转到/users/nonexistantpage,它应该会失败。检查用户是否请求 url 是否会失败,但在代码级别。

最佳答案

我相信您正在寻找 match() Zend 路由器的方法。看看是否有帮助。

关于zend-framework - Zend 框架 : Checking if route exists from code,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3518911/

相关文章:

node.js - Console.log(err) 使我的网站崩溃

php - Zendfox安装: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'zendfox.zf_core_module' doesn't exist

java - play2 调用子模块中的 Controller 、模型、 View

php - 如何用php Zend框架配置MySQL数据?

php - 我如何解释我的 zend web 应用程序的分析日志?

angular - 未触发对 ActivatedRoute.params 的订阅

ruby-on-rails - 为什么我在 "No route matches [GET]"请求上得到 "delete"? Rails 上的 Ruby

ruby-on-rails - 动态嵌套命名空间路由 rails

php - Zend 的可能缺点

zend-framework - Adobe Reader 无法打开在 Zend Framework 中使用 mPDF 创建的 .pdf 文件