Table of Contents
yii框架目录结构详细分析说明
您可能感兴趣的文章
Home php教程 php手册 yii框架目录结构详细分析说明

yii框架目录结构详细分析说明

Jun 13, 2016 am 09:07 AM
yii Directory Structure

yii框架目录结构详细分析说明

 本文详细的列举了用yii开发一个项目的目录结构以及目录说明,正在学习php框架yii的朋友可以收藏看看。

  /****yii核心源码目录结构说明****/ |--framework 框架核心库     |--base 底层类库文件夹,包含CApplication(应用类,负责全局的用户请求处理,它管理的应用组件集,将提供特定功能给整个应用程序);CComponent(组件类,该文件包含了基于组件和事件驱动编程的基础类,从版本1.1.0开始,一个行为的属性(或者它的公共成员变量或它通过getter和/或setter方法定义的属性)可以通过组件的访问来调用);CBehavior(行为类,主要负责声明事件和相应事件处理程序的方法、将对象的行为附加到组件等等);CModel(模型类,为所有的数据模型提供的基类);CModule(是模块和应用程序的基类,主要负责应用组件和子模块)等等     |--caching 所有缓存方法,其中包含了Memcache缓存,APC缓存,数据缓存,CDummyCache虚拟缓存,CEAcceleratorCache缓存等等各种缓存方法     |--cli YII项目生成脚本     |--collections 用php语言构造传统OO语言的数据存储单元。如:队列,栈,哈希表等等     |--console YII控制台     |--db 数据库操作类     |--gii YII 代码生成器(脚手架),能生成包括模型,控制器,视图等代码     |--i18n YII 多语言,提供了各种语言的本地化数据,信息、文件的翻译服务、本地化日期和时间格式,数字等     |--logging 日志组件,YII提供了灵活和可扩展的日志记录功能。消息记录可分为根据日志级别和信息类别。应用层次和类别过滤器,可进一步选择的消息路由到不同的目的地,例如文件,电子邮件,浏览器窗口,等等 |--messages 提示信息的多语言     |--test YII提供的测试,包括单元测试和功能测试     |--utils 提供了常用的格式化方法     |--validators 提供了各种验证方法     |--vendors 这个文件夹包括第三方由Yii框架使用的资料库     |--views 提供了YII错误、日志、配置文件的多语言视图     |--web YII所有开发应用的方法         |---actions 控制器操作类         |---auth 权限认识类,包括身份认证,访问控制过滤,基本角色的访问控制等         |---filters 过滤器,可被配置在控制器动作执行之前或之后执行。例如,访问控制过滤器将被执行以确保在执行请求的动作之前用户已通过身份验证;性能过滤器可用于测量控制器执行所用的时间         |---form 表单生成方法         |---helpers 视图助手,包含GOOGLE AJAX API,创建HTML,JSON,JAVASCRIPT相关功能         |---js JS库          |---renderers 视图渲染组件         |---services 封装SoapServer并提供了一个基于WSDL的Web服务         |---widgets 部件         |---CArrayDataProvider.php 可以配置的排序和分页属性自定义排序和分页的行为         |---CActiveDataProvider.php ActiveRecord方法类         |---CController.php 控制器方法,主要负责协调模型和视图之间的交互 /****下面是具体的项目目录结构说明****/ |--blog_phpernote.com/     |--index.php                 Web 应用入口脚本文件     |--assets/                   包含公开的资源文件     |--css/                      包含 CSS 文件     |--images/                   包含图片文件     |--themes/                   包含应用主题     |--protected/                包含受保护的应用文件     |--yiic                      yiic 命令行脚本     |--yiic.bat                  Windows 下的 yiic 命令行脚本     |--commands/                 包含自定义的 'yiic' 命令         |--shell/                包含自定义的 'yiic shell' 命令     |--components/               包含可重用的用户组件         |--MainMenu.php          'MainMenu' 挂件类         |--Identity.php          用来认证的 'Identity' 类         |--views/                包含挂件的视图文件             |--mainMenu.php      'MainMenu' 挂件的视图文件     |--config/                   包含配置文件         |--console.php           控制台应用配置         |--main.php              Web 应用配置     |--controllers/              包含控制器的类文件         |--SiteController.php    默认控制器的类文件         |--data/                     包含示例数据库             |--schema.mysql.sql      示例 MySQL 数据库             |--schema.sqlite.sql     示例 SQLite 数据库             |--testdrive.db          示例 SQLite 数据库文件     |--extensions/               包含第三方扩展     |--messages/                 包含翻译过的消息     |--models/                   包含模型的类文件         |--LoginForm.php         'login' 动作的表单模型         |--ContactForm.php       'contact' 动作的表单模型     |--runtime/                  包含临时生成的文件     |--views/                    包含控制器的视图和布局文件         |--layouts/              包含布局视图文件             |--main.php          所有视图的默认布局             |--column1.php       使用单列页面使用的布局             |--column2.php       使用双列的页面使用的布局         |--site/                 包含 'site' 控制器的视图文件             |--pages/            包含 "静态" 页面                 |--about.php     "about" 页面的视图             |--contact.php       'contact' 动作的视图             |--error.php         'error' 动作的视图(显示外部错误)             |--index.php         'index' 动作的视图             |--login.php         'login' 动作的视图         |--system/               包含系统视图文件

您可能感兴趣的文章

  • php获取目录所有文件并将结果保存到数组的程序
  • Linux命令文件目录管理cat命令
  • php打造属于自己的MVC框架简单案例,提供思路,仅供参考
  • Jquery动画效果简单总结
  • smarty模板中使用php函数以及smarty模板中如何对一个变量使用多个函数
  • 数据库查询结果如何按照汉字首字的拼音排序
  • php清空(删除)指定目录下的文件,不删除目录文件夹的方法
  • dedeCMS(织梦)网站服务器目录安全设置经验分享
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to use PHP framework Yii to develop a highly available cloud backup system How to use PHP framework Yii to develop a highly available cloud backup system Jun 27, 2023 am 09:04 AM

With the continuous development of cloud computing technology, data backup has become something that every enterprise must do. In this context, it is particularly important to develop a highly available cloud backup system. The PHP framework Yii is a powerful framework that can help developers quickly build high-performance web applications. The following will introduce how to use the Yii framework to develop a highly available cloud backup system. Designing the database model In the Yii framework, the database model is a very important part. Because the data backup system requires a lot of tables and relationships

Symfony vs Yii2: Which framework is better for developing large-scale web applications? Symfony vs Yii2: Which framework is better for developing large-scale web applications? Jun 19, 2023 am 10:57 AM

As the demand for web applications continues to grow, developers have more and more choices in choosing development frameworks. Symfony and Yii2 are two popular PHP frameworks. They both have powerful functions and performance, but when faced with the need to develop large-scale web applications, which framework is more suitable? Next we will conduct a comparative analysis of Symphony and Yii2 to help you make a better choice. Basic Overview Symphony is an open source web application framework written in PHP and is built on

How to use Yii3 framework in php? How to use Yii3 framework in php? May 31, 2023 pm 10:42 PM

As the Internet continues to develop, the demand for web application development is also getting higher and higher. For developers, developing applications requires a stable, efficient, and powerful framework, which can improve development efficiency. Yii is a leading high-performance PHP framework that provides rich features and good performance. Yii3 is the next generation version of the Yii framework, which further optimizes performance and code quality based on Yii2. In this article, we will introduce how to use Yii3 framework to develop PHP applications.

Data query in Yii framework: access data efficiently Data query in Yii framework: access data efficiently Jun 21, 2023 am 11:22 AM

The Yii framework is an open source PHP Web application framework that provides numerous tools and components to simplify the process of Web application development, of which data query is one of the important components. In the Yii framework, we can use SQL-like syntax to access the database to query and manipulate data efficiently. The query builder of the Yii framework mainly includes the following types: ActiveRecord query, QueryBuilder query, command query and original SQL query

Yii2 vs Phalcon: Which framework is better for developing graphics rendering applications? Yii2 vs Phalcon: Which framework is better for developing graphics rendering applications? Jun 19, 2023 am 08:09 AM

In the current information age, big data, artificial intelligence, cloud computing and other technologies have become the focus of major enterprises. Among these technologies, graphics card rendering technology, as a high-performance graphics processing technology, has received more and more attention. Graphics card rendering technology is widely used in game development, film and television special effects, engineering modeling and other fields. For developers, choosing a framework that suits their projects is a very important decision. Among current languages, PHP is a very dynamic language. Some excellent PHP frameworks such as Yii2, Ph

Yii2 Programming Guide: How to run Cron service Yii2 Programming Guide: How to run Cron service Sep 01, 2023 pm 11:21 PM

If you're asking "What is Yii?" check out my previous tutorial: Introduction to the Yii Framework, which reviews the benefits of Yii and outlines what's new in Yii 2.0, released in October 2014. Hmm> In this Programming with Yii2 series, I will guide readers in using the Yii2PHP framework. In today's tutorial, I will share with you how to leverage Yii's console functionality to run cron jobs. In the past, I've used wget - a web-accessible URL - in a cron job to run my background tasks. This raises security concerns and has some performance issues. While I discussed some ways to mitigate the risk in our Security for Startup series, I had hoped to transition to console-driven commands

Yii2 vs Symfony: Which framework is better for API development? Yii2 vs Symfony: Which framework is better for API development? Jun 18, 2023 pm 11:00 PM

With the rapid development of the Internet, APIs have become an important way to exchange data between various applications. Therefore, it has become increasingly important to develop an API framework that is easy to maintain, efficient, and stable. When choosing an API framework, Yii2 and Symfony are two popular choices among developers. So, which one is more suitable for API development? This article will compare these two frameworks and give some conclusions. 1. Basic introduction Yii2 and Symfony are mature PHP frameworks with corresponding extensions that can be used to develop

How to convert yii objects into arrays or directly output to json format How to convert yii objects into arrays or directly output to json format Jan 08, 2021 am 10:13 AM

Yii framework: This article introduces Yii's method of converting objects into arrays or directly outputting them into json format. It has certain reference value and I hope it can help you.

See all articles