Home >Backend Development >PHP Tutorial >How to use yaf modules

How to use yaf modules

WBOY
WBOYOriginal
2016-07-06 13:52:341141browse

See that yaf can have multiple modules. Index and Admin are also configured in the ini, and the default module is Admin. But when it is opened, why does it still prompt /app/controllers/Index.php?

<code>application.dispatcher.defaultModule = "Admin"
application.dispatcher.defaultController = "Index"
application.dispatcher.defaultAction = "index"
application.modules = "Index,Admin"</code>

When accessing the domain directly, the displayed index is still Index/Index/index
But when accessing the domain/Admin/, the error displayed is that Index/Admin.php cannot be found
What is happening? thing?
Which master can teach me how to use the yaf module? Are there still things under the module that won't be loaded automatically? Or what's going on?

How to use yaf modules

Reply content:

See that yaf can have multiple modules. Index and Admin are also configured in the ini, and the default module is Admin. But when it is opened, why does it still prompt /app/controllers/Index.php?

<code>application.dispatcher.defaultModule = "Admin"
application.dispatcher.defaultController = "Index"
application.dispatcher.defaultAction = "index"
application.modules = "Index,Admin"</code>

When accessing the domain directly, the displayed index is still Index/Index/index
But when accessing the domain/Admin/, the error displayed is that Index/Admin.php cannot be found
What is happening? thing?
Which master can teach me how to use the yaf module? Are there still things under the module that won't be loaded automatically? Or what's going on?

How to use yaf modules

The default module is the index module, which can be found in the controllers directory
The custom module can be found in the modules folder and configured in the ini file

<code>application.modules = "Index,Admin"
</code>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn