How does ZendFramework define a model?

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.