Home  >  Article  >  Backend Development  >  In-depth learning of Yii2--inheritance relationship, in-depth learning of yii2--_PHP tutorial

In-depth learning of Yii2--inheritance relationship, in-depth learning of yii2--_PHP tutorial

WBOY
WBOYOriginal
2016-07-12 09:06:34820browse

In-depth learning of Yii2--inheritance relationship, in-depth learning of yii2--

If you want to understand Yii2, you must understand the inheritance relationship of related classes in Yii2. Due to the limited code that can be read temporarily, only part of the inheritance relationships are listed in the figure below, which will be added later as more and more source codes are read

As you can see from the above figure, most classes in Yii2 inherit from yiibaseObject and implement the function of attributes.

yiibaseComponent, yiibaseEvent and yiibaseBehavior both inherit yiibaseObject. yiibaseComponent is a base class that implements properties/events and behavior functions. yiibaseEvent is the base class for all events, and yiibaseBehavior is the base class for all behaviors.

Model/View and Controller both inherit from yiibaseComponent.

I’m tired today, so I’ll be lazy and write less, that’s all O(∩_∩)O

Students who are interested in the Yii2 source code can pay attention to the project yii2-2.0.3-annotated. A lot of comments about the Yii2 source code have been added to it, and they will continue to be added in the future~

Interested students can also participate and submit comments on the Yii2 source code.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1064530.htmlTechArticleIn-depth learning of Yii2 - inheritance relationship, in-depth learning of yii2 - If you want to understand Yii2, you must learn about Yii2 Understand the inheritance relationship between related classes. Due to the limited code that can be read temporarily, the following...
Statement:
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