Zend Framework 1.1 模块设置

发布于 2024-08-25 17:55:39 字数 517 浏览 5 评论 0原文

我使用 zend_tool 设置一个项目,然后使用索引控制器等创建模块博客,但我猜 zend_tool 的默认配置设置不适用于模块,所以我编辑了

resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.moduleDirectoryControllerName = "controllers"

它这些是模块所必需的吗?我还将文件夹、controllers、models、view 移动到 modules/ 文件夹中,

但当我尝试访问 http://servername 时出现空白屏幕 它应该加载默认模块的索引控制器和操作。即使我尝试访问 http://servername/nonexistentpage 它也会显示空白屏幕而不是 404

i used zend_tool to setup a project then to create module blog with index controller etc but i guess the default config setup by zend_tool does not work with modules so i edited it

resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.moduleDirectoryControllerName = "controllers"

i guess these are required for modules? also i moved the folders, controllers, models, views into the modules/ folder

but i get a blank screen when i try to go to http://servername which shld load Default module's index controller and action. even if i try to go http://servername/nonexistentpage it also shows a blank screen instead of a 404

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

青丝拂面 2024-09-01 17:55:39

您不必移动控制器模型视图
这些是 default 模块的目录,它不放置在 modules 目录中(默认情况下)。

您所需要的只是:

resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[] =

如果您也想将默认的模块放入模块中,则必须像这样设置应用程序:

; Default Application Resource Namespace
appnamespace = "YourPrefix"

; FrontController Resource Settings
resources.frontController.defaultController = "index"
resources.frontController.defaultAction = "index"
resources.frontController.defaultModule = "modulename"
resources.frontController.prefixDefaultModule = true
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.params.displayExceptions = 1

您看不到任何内容的原因是该应用程序会抛出错误,但由于您的配置而不会显示这些错误。尝试以下设置:

phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1

确保您的 .htaccess 中有 SetEnv APPICATION_ENVdevelopment

将 Zend Framework 升级到最新版本。最新的 Zend Tool 生成 /docs 目录,其中包含 README.txt,其中描述了如何设置虚拟主机。

希望这会有所帮助:)

并且......
欢迎来到SO!

You don't have to move controllers, models, and views.
These are directories of the default module, which is not placed in modules directory (by default).

All you need is:

resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[] =

If you want to place default module in the modules too, you have to set up the app like this:

; Default Application Resource Namespace
appnamespace = "YourPrefix"

; FrontController Resource Settings
resources.frontController.defaultController = "index"
resources.frontController.defaultAction = "index"
resources.frontController.defaultModule = "modulename"
resources.frontController.prefixDefaultModule = true
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.params.displayExceptions = 1

The reason you do not see anything is that the app throws errors, which are not shown due to your configuration. Try these settings:

phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1

Ensure you have SetEnv APPICATION_ENV development in your .htaccess

Upgrade Zend Framework to the newest version. Newest Zend Tool generates /docs directory with README.txt, which describes how to set up virtual host.

Hope this helps :)

And…
Welcome to the SO!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文