Zend Framework怎么定义一个model
Zend Framework如何定义一个model
1.Zend Framework如何定义一个model,也就是说model的命名规则是怎么样的(分单模块和多模块)
2.model所存放的文件的文件名的规则有哪些(分单模块和多模块)
3.model该extends谁?
帮我解决一下上边三个疑惑,在这里先谢谢大家先。
------解决方案--------------------
我的models目录位于application下。
在models目录中,可能还会建立目录。比如一些全局的model,我放在system目录下,一些针对每个controller的model,我放在link目录下。
application
->models
->system
->link
model文件的命名规则为:
class Model_link_Article{
...
}
以下划线分开,第一个他表示的目录默认在application/models,第二个为你自定义的目录,第三个就是你用于标示这个类的名字。整体的命名就应该是这样的。
在BootStrap.php的_initAutoload方法中:
$moduleLoader = new Zend_Application_Module_Autoloader ( array( 'namespace' => '', 'basePath' =>'application的物理路径' ) );
return $moduleLoader;
然后你在controller里面new Model_link_Article,就可以了。或者直接调用静态方法Model_link_Article::xxx();
注意,在linux上,目录名是区分大小写的。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The python environment this article relies on is: What is WSGI? WSGI is also called the web server universal gateway interface, and its full name is webservergatewayinterface. It defines a standard for how web servers and web applications should communicate and handle http requests and responses in Python. Note that it is just a protocol, or a specification or standard. You don’t have to follow this standard. Just like the web server we wrote in the previous article. WSGI is also divided into applications and server gateways. Among them, the well-known Flask belongs to applications, and uWSGI and wsgiref belong to server gateways. Personal feeling, WSG

After problems occurred in many centralized exchanges, more and more cryptocurrency investors began to transfer assets to cold wallets to reduce the risks posed by centralized exchanges. This article will introduce Trezor, the world's earliest cold wallet provider. Since the first cold wallet was launched in 2014, it has been sold in many countries around the world. Trezor's products include Model One launched in 2014 and the advanced version Model T launched in 2018. The following will continue to introduce the differences between these two products and other cold wallets. What is Trezor cold wallet? In 2014, Trezor launched the first cold wallet ModelOne. In addition to common BTC, ETH, USDT and other currencies, the wallet also supports more than 1,000 other currencies.

In-depth analysis: What is the difference between link and import? When developing web pages or applications, we often need to introduce external CSS files or JavaScript libraries to enhance or customize our code. In this process, link and import are two commonly used methods. Although their purpose is to introduce external resources, there are some differences in specific usage. Syntax and location: link: Use the link tag to link external resources into the HTML file, usually located at the head of the HTML document

The differences between link tags and import include syntax and usage, functions and features, loading timing, compatibility and support, etc. Detailed introduction: 1. Syntax and usage. The link tag is an HTML tag, used to introduce external resources into HTML documents, such as CSS style sheets, JavaScript scripts, icons, etc. import is the module import syntax in ES6, used in JavaScript files. Introduce external modules; 2. Functions and features. The link tag can introduce a variety of resources, such as CSS style sheets, icons, etc.

The link tag and the a tag are two commonly used tags in HTML. They have different functions and usages. link tag The link tag is mainly used to introduce external resources into HTML documents. It is usually used to introduce external style sheets (CSS files). It can also be used to introduce other types of files, such as image files, audio files, etc. The link tag is located within the tag, usually written after other metadata (such as tags). Basic grammatical format of link tag

The difference between bootstrap and application explains that both bootstrap and application are configuration files in the SpringBoot project. Their differences mainly include the following aspects (1) Loading order difference. The bootstrap configuration file is loaded first than the application configuration file, because bootstrap is composed of The spring parent context is loaded, and the application is loaded by the child context (2) Priority difference The configuration information loaded by bootstrap cannot be overwritten by the same configuration of the application. If two configuration files exist at the same time, bootstrap will be the main one (

Django is an open source Python web framework. It adopts the MVT (Model-View-Template) architectural pattern and divides the application into three parts: Model, View and Template. Among them, Model is a basic component in the Django framework, used to define and manage data. This article will provide a detailed explanation of Model in the Django framework. What is Model in Django

The difference between using link and import lies in function, purpose, introduction method, compatibility and applicable scenarios, etc. Detailed introduction: 1. The link tag is used to introduce an external style sheet. It can associate the external style sheet with the HTML document to control the style and layout of the document. The link tag can be used in the head part or body part of the HTML document; 2 The import tag is used to introduce external HTML documents, which can embed one HTML document into another HTML document, modularize and reuse, etc.
