When using the default routing of the framework for access, there may be some problems. This part cannot view the source code and can only be analyzed by speculation.
If the project has multiple modules, it is clear that the default static route using yaf cannot meet the requirements.
The default yaf configuration is as follows:
application.baseUri=”/======Index
Explain the functions in turn
Application. baseUri = "/" indicates that the domain is followed by the content to be parsed. If our application is accessed through folder, baseUri is/a. Therefore, the purpose of this baseuri is to indicate which parts need to be processed by the route and which parts are actually paths.
The default module is Index,
Application. dispatcher. defaultModule = Index
This statement is tested and found to be invalid. That is to say, the default module cannot be modified through configuration,
While
Application. dispatcher. defaultController = Index
Application. dispatcher. defaultAction = index
That is, the default controller and default action can be assigned accordingly.
Then, add a module for the route. When creating a new module, notify the added module to the route so that the route can perform this operation when requesting a new module.
Application. modules = Index uses this sentence. If you want to add the new module Myoo, you must write it after the Index, Myoo ().
Change to application. modules = Index, Myoo
The routing of the original framework is basically a default module, but the default controller and action cannot be changed to a dead index.
The advantage of this situation is that each module has a specified controller and action. To access the index controller indexaction of the myoo module, you only need to write a module name myoo.
Currently, yaf cannot. The default mudule is writable, while the default controller and action are used by the default module. If you want to access myoo/index/, you can only write all of them, instead of writing only myoo, writing only myoo without the controller and action, the routing still does not know where the final destination is, and will not be found from the module, myoo is parsed into a controller of the default module, and then a 404 error is thrown,
This is enough.
However, I think it is a bug that the default module cannot be changed, because if it cannot be changed, why should we configure this configuration item.