How does ZendFramework define a model1.ZendFramework and a model? that is to say, what is the naming rule of the model (single module and multi-module)? 2. what are the naming rules for the files stored by the model (single module and multi-module)? 3. who should model extends? Help me solve the above three questions. thank you for your consideration. ------ Solution ------------- How does Zend Framework define a model?
1. how does Zend Framework define a model, that is, what is the naming rule of the model (single module and multi-module)
2. what are the naming rules for the files stored by the model (single module and multi-module)
3. Who should model extends?
Help me solve the above three questions. thank you for your consideration.
------ Solution --------------------
My models directory is located under application.
You may also create a directory in the models directory. For example, I put some global models under the system directory, and some models for each controller, I put them under the link directory.
Application
-> Models
-> System
-> Link
The naming rules for model files are as follows:
Class Model_link_Article {
...
}
The following lines are separated. The first directory is in application/models by default, the second is the custom directory for you, and the third is the name you used to mark this class. The overall name should be like this.
In the _ initAutoload method of BootStrap. php:
$ ModuleLoader = new Zend_Application_Module_Autoloader (array ('namespace '=> '', 'basepath' => 'application physical path '));
Return $ moduleLoader;
Then you can create new Model_link_Article in the controller. Or directly call the static method Model_link_Article: xxx ();
Note: In linux, directory names are case sensitive.