说明:这个规范应该是基本的规范了吧。大部分程序员都知道这样的规范,从规范上看应该是使用ZendFramework开发的。
参考一下:
开发原则
1.业务逻辑统一写在数据库的存储过程里,数据查询和组合在程序中完成
2.存储过程统一用专用程序修改,禁止直接在客户端修改
3.存储过程头部必须撰写该操作的业务流程描述
4.数据库对于带小数点数字统一使用 DECIMAL 类型,禁止使用 FLOAT 类型
5.数据库主键统一使用 BIGINT(20) UNSIGNED AUTO INCREMENT
6.所有 CSS/JavaScript 均按各自功能写在独立的文件上
7.所有 JavaScript 均使用 jQuery App 插件形式撰写
8.视图上只使用页面控件输出数据
9.控制器只负责获取数据、设置页面控件或调用模型操作
10.控制器每个业务操作动作只允许调用一个模型的一个方法
11.模型不一定操作数据库,但自身必须定义或保存数据,否则应为助手
12.助手可以为纯静态类或可实例化的对象
13.使用 PHPDoc 标准注释每个对象、方法、函数和变量相关基本信息
14.关键处理或逻辑必须详细说明
15.助手名称必须以 Helper 结尾
16.模型名称不需要加上 Model
17.统一使用 Igou::modx() 代替 global $modx
18.统一使用 Zend_Db_Select 组装 SQL 语句
1.数据表主键统一使用 id 作为字段名
2.数据库字段名称单词之间使用 _ 分割,禁止两个单词连写
3.所有爱购网自建数据表加上 igou_ 前缀,方便与 modx 区分
4.数据表统一使用单数形式
1.变量、方法和函数统一使用驼峰式大小写,首字母小写
2.对象名称使用下横线分隔单词,单词首字母大写
3.常量统一使用单数形式
4.自定义常量统一加上 IGOU_ 前缀
5.纯 PHP 文件结尾不写 ?>
6.源代码文件行尾不留空格(包括空行)
7.非公开方法或属性(变量)名字加 _ 前缀
2.外接代码片段可使用 [!控制器::动作!] 形式调用 若无指定控制器则调用 Index 控制器的方法
3.代码片段对应 Action 返回内容时使用 $this->_response->setBody('内容');
4.所有外接代码片段的调用工作由 Plugins 的 SnippetsController 执行
5.全局公用的 View Helper 放在 library/Igou/View/Helper 下

Long URLs, often cluttered with keywords and tracking parameters, can deter visitors. A URL shortening script offers a solution, creating concise links ideal for social media and other platforms. These scripts are valuable for individual websites a

Following its high-profile acquisition by Facebook in 2012, Instagram adopted two sets of APIs for third-party use. These are the Instagram Graph API and the Instagram Basic Display API.As a developer building an app that requires information from a

Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

This is the second and final part of the series on building a React application with a Laravel back-end. In the first part of the series, we created a RESTful API using Laravel for a basic product-listing application. In this tutorial, we will be dev

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

The 2025 PHP Landscape Survey investigates current PHP development trends. It explores framework usage, deployment methods, and challenges, aiming to provide insights for developers and businesses. The survey anticipates growth in modern PHP versio


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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 English version
Recommended: Win version, supports code prompts!

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver Mac version
Visual web development tools
