Commit ef71a97e by Qiang Xue

renamed chapter to section [skip ci]

parent 2c7615a3
Bootstrap Widgets
=================
> Note: This chapter is under development.
> Note: This section is under development.
Out of the box, Yii includes support for the [Bootstrap 3](http://getbootstrap.com/) markup and components framework
(also known as "Twitter Bootstrap"). Bootstrap is an excellent, responsive framework that can greatly speed up the
......
Caching
=======
> Note: This chapter is under development.
> Note: This section is under development.
Caching is a cheap and effective way to improve the performance of a web application. By storing relatively
static data in cache and serving it from cache when requested, the application saves the time required to generate the data from scratch. Caching is one of the best ways to improve the performance of your application, almost mandatory on any large-scale site.
......
......@@ -6,7 +6,7 @@ to locate and include required class files. It provides a high-performance class
[PSR-4 standard](https://github.com/php-fig/fig-standards/blob/master/proposed/psr-4-autoloader/psr-4-autoloader.md).
The autoloader is installed when you include the `Yii.php` file.
> Note: For simplicity of description, in this chapter we will only talk about autoloading of classes. However, keep in
> Note: For simplicity of description, in this section we will only talk about autoloading of classes. However, keep in
mind that the content we are describing here applies to autoloading of interfaces and traits as well.
......
......@@ -15,7 +15,7 @@ Using Behaviors
---------------
To use a behavior, you first need to attach it to a [[yii\base\Component|component]]. We will describe how to
attach a behavior in the next section.
attach a behavior in the next subsection.
Once a behavior is attached to a component, its usage is straightforward.
......@@ -129,7 +129,7 @@ $component->attachBehavior('myBehavior3', [
```
You may also attach behaviors through [configurations](concept-configurations.md). For more details, please
refer to the [Configurations](concept-configurations.md#configuration-format) chapter.
refer to the [Configurations](concept-configurations.md#configuration-format) section.
<a name="detaching-behaviors"></a>
......@@ -227,7 +227,7 @@ its handler `beforeValidate()`. When specifying an event handler, you may use on
* an anonymous function.
The signature of an event handler should be as follows, where `$event` refers to the event parameter. Please refer
to the [Events](concept-events.md) chapter for more details about events.
to the [Events](concept-events.md) section for more details about events.
```php
function ($event) {
......
......@@ -58,7 +58,7 @@ where
defined by getters/setters can be configured.
* The `on eventName` elements specify what handlers should be attached to the object [events](concept-events.md).
Notice that the array keys are formed by prefixing event names with `on `. Please refer to
the [Events](concept-events.md) chapter for supported event handler formats.
the [Events](concept-events.md) section for supported event handler formats.
* And the `as behaviorName` elements specify what [behaviors](concept-behaviors.md) should be attached to the object.
Notice that the array keys are formed by prefixing behavior names with `on `. `$behaviorConfig` represents
the configuration for creating a behavior, like a normal configuration as we are describing here.
......@@ -84,8 +84,8 @@ Below is an example showing a configuration with property initial values, event
Using Configurations
--------------------
Configurations are used in many places in Yii. At the beginning of this chapter, we have shown how to use
create an object according to a configuration by using [[Yii::createObject()]]. In this section, we will
Configurations are used in many places in Yii. At the beginning of this section, we have shown how to use
create an object according to a configuration by using [[Yii::createObject()]]. In this subsection, we will
describe application configurations and widget configurations - two major usages of configurations.
......@@ -138,7 +138,7 @@ an [entry script](structure-entry-scripts.md), where the class name is already g
```
For more details about configuring the `components` property of an application can be found
in the [Applications](structure-applications.md) chapter and the [Service Locator](concept-service-locator.md) chapter.
in the [Applications](structure-applications.md) section and the [Service Locator](concept-service-locator.md) section.
<a name="widget-configurations"></a>
......
......@@ -129,7 +129,7 @@ $foo->on(Foo::EVENT_HELLO, function ($event) {
```
You may also attach event handlers through [configurations](concept-configurations.md). For more details, please
refer to the [Configurations](concept-configurations.md#configuration-format) chapter.
refer to the [Configurations](concept-configurations.md#configuration-format) section.
When attaching an event handler, you may provide additional data as the third parameter to [[yii\base\Component::on()]].
......@@ -201,7 +201,7 @@ $foo->off(Foo::EVENT_HELLO);
Class-Level Event Handlers
--------------------------
In the above sections, we have described how to attach a handler to an event at *instance level*.
In the above subsections, we have described how to attach a handler to an event at *instance level*.
Sometimes, you may want to respond to an event triggered by EVERY instance of a class instead of
a specific instance. Instead of attaching an event handler to every instance, you may attach the handler
at *class level* by calling the static method [[yii\base\Event::on()]].
......
Active Record
=============
> Note: This chapter is under development.
> Note: This section is under development.
[Active Record](http://en.wikipedia.org/wiki/Active_record_pattern) provides an object-oriented interface
for accessing data stored in a database. An Active Record class is associated with a database table,
......
Database basics
===============
> Note: This chapter is under development.
> Note: This section is under development.
Yii has a database access layer built on top of PHP's [PDO](http://www.php.net/manual/en/book.pdo.php). It provides
uniform API and solves some inconsistencies between different DBMS. By default Yii supports the following DBMS:
......
Database Migration
==================
> Note: This chapter is under development.
> Note: This section is under development.
Like source code, the structure of a database evolves as a database-driven application is developed and maintained. For example, during development, a new table may be added; Or, after the application goes live, it may be discovered that an additional index is required. It is important to keep track of these structural database changes (called **migration**), just as changes to the source code is tracked using version control. If the source code and the database become out of sync, bugs will occur, or the whole application might break. For this reason, Yii provides a database migration
tool that can keep track of database migration history, apply new migrations, or revert existing ones.
......
Query Builder and Query
=======================
> Note: This chapter is under development.
> Note: This section is under development.
Yii provides a basic database access layer as described in the [Database basics](database-basics.md) section.
The database access layer provides a low-level way to interact with the database. While useful in some situations,
......
Extending Yii
=============
> Note: This chapter is under development.
> Note: This section is under development.
The Yii framework was designed to be easily extendable. Additional features can be added to your project and then reused, either by yourself on other projects or by sharing your work as a formal Yii extension.
......
Helper Classes
==============
> Note: This chapter is under development.
> Note: This section is under development.
Yii provides many classes that help simplify common coding tasks, such as string or array manipulations,
HTML code generation, and so forth. These helper classes are organized under the `yii\helpers` namespace and
......
Composer
========
> Note: This chapter is under development.
> Note: This section is under development.
Yii2 uses Composer as its dependency management tool. Composer is a PHP utility that can automatically handle the installation of needed libraries and
extensions, thereby keeping those third-party resources up to date while absolving you of the need to manually manage the project's dependencies.
......
Using 3rd-Party Libraries
=========================
> Note: This chapter is under development.
> Note: This section is under development.
Yii is carefully designed so that third-party libraries can be
easily integrated to further extend Yii's functionalities.
......
Helpers
=======
> Note: This chapter is under development.
> Note: This section is under development.
Helper classes typically contain static methods only and are used as follows:
......
Working with forms
==================
> Note: This chapter is under development.
> Note: This section is under development.
The primary way of using forms in Yii is through [[yii\widgets\ActiveForm]]. This approach should be preferred when
the form is based upon a model. Additionally, there are some useful methods in [[yii\helpers\Html]] that are typically
......
Model validation reference
==========================
> Note: This chapter is under development.
> Note: This section is under development.
As a model both represents data and defines the business rules to which that data must adhere, comprehending data validation is key to using Yii. In order to learn model validation basics, please refer to [Model, Validation subsection](model.md#Validation).
......
......@@ -283,7 +283,7 @@ the declarations in [[yii\console\Controller::options()]].
Yii 2.0 supports automatic generation of command help information from comment blocks.
Please refer to the [Console Commands](tutorial-console.md) chapter for more details.
Please refer to the [Console Commands](tutorial-console.md) section for more details.
I18N
......@@ -320,7 +320,7 @@ public function behaviors()
}
```
Please refer to the [Filtering](runtime-filtering.md) chapter for more details.
Please refer to the [Filtering](runtime-filtering.md) section for more details.
Assets
......@@ -334,7 +334,7 @@ By registering an asset bundle via [[yii\web\AssetBundle::register()]], you will
the assets in that bundle accessible via Web, and the page registering the bundle will automatically
contain the references to the JavaScript and CSS files specified in that bundle.
Please refer to the [Managing Assets](output-assets.md) chapter for more details.
Please refer to the [Managing Assets](output-assets.md) section for more details.
Helpers
......@@ -390,7 +390,7 @@ $rows = $command->queryAll();
Best of all, such query building methods can also be used when working with [Active Record](db-active-record.md).
Please refer to the [Query Builder](db-query-builder.md) chapter for more details.
Please refer to the [Query Builder](db-query-builder.md) section for more details.
Active Record
......@@ -446,7 +446,7 @@ $customers = Customer::find()->asArray()->all();
```
There are many other changes and enhancements to Active Record. Please refer to
the [Active Record](db-active-record.md) chapter for more details.
the [Active Record](db-active-record.md) section for more details.
User and IdentityInterface
......@@ -480,5 +480,5 @@ Using Yii 1.1 and 2.x together
------------------------------
If you have legacy Yii 1.1 code and you want to use it together with Yii 2.0, please refer to
the [Using Yii 1.1 and 2.0 Together](extend-using-v1-v2.md) chapter.
the [Using Yii 1.1 and 2.0 Together](extend-using-v1-v2.md) section.
Managing assets
===============
> Note: This chapter is under development.
> Note: This section is under development.
An asset in Yii is a file that is included into the page. It could be CSS, JavaScript or
any other file. The framework provides many ways to work with assets from basics such as adding `<script src="...">` tags
......
Data providers
==============
> Note: This chapter is under development.
> Note: This section is under development.
Data provider abstracts data set via [[yii\data\DataProviderInterface]] and handles pagination and sorting.
It can be used by [grids](data-grid.md), [lists and other data widgets](data-widgets.md).
......
Data widgets
============
> Note: This chapter is under development.
> Note: This section is under development.
ListView
--------
......
Implementing RESTful Web Service APIs
=====================================
> Note: This chapter is under development.
> Note: This section is under development.
Yii provides a whole set of tools to greatly simplify the task of implementing RESTful Web Service APIs.
In particular, Yii provides support for the following aspects regarding RESTful APIs:
......@@ -315,7 +315,7 @@ For API endpoints about resource collections, pagination is supported out-of-box
through query parameters `page` and `per-page`, an API consumer may specify which page of data
to return and how many data items should be included in each page. The corresponding response
will include the pagination information by the following HTTP headers (please also refer to the first example
in this chapter):
in this section):
* `X-Pagination-Total-Count`: The total number of data items;
* `X-Pagination-Page-Count`: The number of pages;
......@@ -701,7 +701,7 @@ Authorization
After a user is authenticated, you probably want to check if he has the permission to perform the requested
action for the requested resource. This process is called *authorization* which is covered in detail in
the [Authorization chapter](authorization.md).
the [Authorization section](authorization.md).
You may use the Role-Based Access Control (RBAC) component to implementation authorization.
......
URL Management
==============
> Note: This chapter is under development.
> Note: This section is under development.
The concept of URL management in Yii is fairly simple. URL management is based on the premise that the application uses
internal routes and parameters everywhere. The framework itself will then translate routes into URLs, and vice versa, according to the URL manager's configuration. This approach allows you to change site-wide URLs merely by
......
Authentication
==============
> Note: This chapter is under development.
> Note: This section is under development.
Authentication is the act of verifying who a user is, and is the basis of the login process. Typically, authentication uses the combination of an identifier--a username or email address--and a password. The user submits these values through a form, and the application then compares the submitted information against that previously stored (e.g., upon registration).
......
Authorization
=============
> Note: This chapter is under development.
> Note: This section is under development.
Authorization is the process of verifying that a user has enough permission to do something. Yii provides two authorization
methods: Access Control Filter (ACF) and Role-Based Access Control (RBAC).
......
Security
========
> Note: This chapter is under development.
> Note: This section is under development.
Good security is vital to the health and success of any application. Unfortunately, many developers cut corners when it comes to security, either due to a lack of understanding or because implementation is too much of a hurdle. To make your Yii powered application as secure as possible, Yii has included several excellent and easy to use security features.
......
Basic application template
==========================
> Note: This chapter is under development.
> Note: This section is under development.
The basic Yii application template is a perfect fit for small projects or when you're just learning the framework.
......
Installation
============
> Note: This chapter is under development.
> Note: This section is under development.
There are two ways you can install the Yii framework:
......
Request Lifecycle
=================
> Note: This chapter is under development.
> Note: This section is under development.
The following diagram shows a typical workflow of a Yii application handling a user request:
......
Application Structure
=====================
> Note: This chapter is under development.
> Note: This section is under development.
Yii implements the model-view-controller (MVC) design pattern, which is
widely adopted in Web and other application programming. MVC aims to separate business logic from
......
Controller
==========
> Note: This chapter is under development.
> Note: This section is under development.
Controller is one of the key parts of the application. It determines how to handle incoming request and creates a response.
......
Entry Scripts
=============
> Note: This chapter is under development.
> Note: This section is under development.
Configuring options in the bootstrap file
-----------------------------------------
......
Model
=====
> Note: This chapter is under development.
> Note: This section is under development.
In keeping with the MVC approach, a model in Yii is intended for storing or temporarily representing application data, as well as defining the busines rules by which the data must abide.
......
View
====
> Note: This chapter is under development.
> Note: This section is under development.
The view component is an important part of MVC. The view acts as the interface to the application, making it responsible
for presenting data to end users, displaying forms, and so forth.
......
Fixtures
========
> Note: This chapter is under development.
> Note: This section is under development.
Fixtures are important part of testing. Their main purpose is to set up the environment in a fixed/known state
so that your tests are repeatable and run in an expected way. Yii provides a fixture framework that allows
......
Debug toolbar and debugger
==========================
> Note: This chapter is under development.
> Note: This section is under development.
Yii2 includes a handy toolbar, and built-in debugger, for faster development and debugging of your applications. The toolbar displays information
about the currently opened page, while the debugger can be used to analyze data you've previously collected (i.e., to confirm the values of variables).
......
The Gii code generation tool
============================
> Note: This chapter is under development.
> Note: This section is under development.
Yii includes a handy tool, named Gii, that provides rapid prototyping by generating commonly used code snippets
as well as complete CRUD controllers.
......
Advanced application template
=============================
> Note: This chapter is under development.
> Note: This section is under development.
This template is for large projects developed in teams where the backend is divided from the frontend, application is deployed
to multiple servers etc. This application template also goes a bit further regarding features and provides essential
......
Console applications
====================
> Note: This chapter is under development.
> Note: This section is under development.
Yii has full featured support for console applications, whose structure is very similar to a Yii web application. A console application
consists of one or more [[yii\console\Controller]] classes, which are often referred to as "commands" in the console environment. Each controller can also have one or more actions, just like web controllers.
......
Error Handling
==============
> Note: This chapter is under development.
> Note: This section is under development.
Error handling in Yii is different than handling errors in plain PHP. First of all, Yii will convert all non-fatal errors
to *exceptions*:
......
Internationalization
====================
> Note: This chapter is under development.
> Note: This section is under development.
Internationalization (I18N) refers to the process of designing a software application so that it can be adapted to
various languages and regions without engineering changes. For Web applications, this is of particular importance
......
Logging
=======
> Note: This chapter is under development.
> Note: This section is under development.
Yii provides flexible and extensible logger that is able to handle messages according to severity level or their type.
You may filter messages by multiple criteria and forward them to files, email, debugger etc.
......
Performance Tuning
==================
> Note: This chapter is under development.
> Note: This section is under development.
The performance of your web application is based upon two parts. First is the framework performance
and the second is the application itself. Yii has a pretty low performance impact
......
Creating your own Application structure
=======================================
> Note: This chapter is under development.
> Note: This section is under development.
While [basic](apps-basic.md) and [advanced](apps-advanced.md) application templates are great for most of your needs
you may want to create your own application template to start your projects with.
......
Using template engines
======================
> Note: This chapter is under development.
> Note: This section is under development.
By default, Yii uses PHP as its template language, but you can configure Yii to support other rendering engines, such as
[Twig](http://twig.sensiolabs.org/) or [Smarty](http://www.smarty.net/).
......
Theming
=======
> Note: This chapter is under development.
> Note: This section is under development.
A theme is a directory of view and layout files. Each file of the theme overrides corresponding file of an application
when rendered. A single application may use multiple themes and each may provide totally different experience. At any
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment