(未完成,譯文持續更新中)
此為 Yii 2的核心框架代碼.
此倉庫是 https://github.com/yiisoft/yii2下的子項目,請對主倉庫提交問題報告、拉取請求。關於許可信息請查閱 LICENSE 文檔。
推薦通過 composer 來安裝Yii框架.
運行
composer global require "fxp/composer-asset-plugin:~1.0.0" composer require yiisoft/yii2
或添加
"yiisoft/yii2": "~2.0.0",
到composer.json 的require section中。
Last-Modified
and Etag
HTTP headers.
yii\filters\PageCache
PageCache implements server-side caching of whole pages.
yii\filters\RateLimitInterface
RateLimitInterface is the interface that may be implemented by an identity object to enforce rate limiting.
yii\filters\RateLimiter
RateLimiter implements a rate limiting algorithm based on the leaky bucket algorithm.
yii\filters\VerbFilter
VerbFilter is an action filter that filters by HTTP request methods.
yii\filters\auth\AuthInterface
AuthInterface is the interface that should be implemented by auth method classes.
yii\filters\auth\AuthMethod
AuthMethod is a base class implementing the yii\filters\auth\AuthInterface interface.
yii\filters\auth\CompositeAuth
CompositeAuth is an action filter that supports multiple authentication methods at the same time.
yii\filters\auth\HttpBasicAuth
HttpBasicAuth is an action filter that supports the HTTP Basic authentication method.
yii\filters\auth\HttpBearerAuth
HttpBearerAuth is an action filter that supports the authentication method based on HTTP Bearer token.
yii\filters\auth\QueryParamAuth
QueryParamAuth is an action filter that supports the authentication based on the access token passed through a query parameter.
yii\grid\ActionColumn
ActionColumn is a column for the yii\grid\GridView widget that displays buttons for viewing and manipulating the items.
yii\grid\CheckboxColumn
CheckboxColumn displays a column of checkboxes in a grid view.
yii\grid\Column
Column is the base class of all yii\grid\GridView column classes.
yii\grid\DataColumn
DataColumn is the default column type for the yii\grid\GridView widget.
yii\grid\GridView
The GridView widget is used to display data in a grid.
yii\grid\GridViewAsset
This asset bundle provides the javascript files for the yii\grid\GridView widget.
yii\grid\SerialColumn
SerialColumn displays a column of row numbers (1-based).
yii\helpers\ArrayHelper
ArrayHelper provides additional array functionality that you can use in your application.
yii\helpers\BaseArrayHelper
BaseArrayHelper provides concrete implementation for yii\helpers\ArrayHelper.
yii\helpers\BaseConsole
BaseConsole provides concrete implementation for yii\helpers\Console.
yii\helpers\BaseFileHelper
BaseFileHelper provides concrete implementation for yii\helpers\FileHelper.
yii\helpers\BaseFormatConverter
BaseFormatConverter provides concrete implementation for yii\helpers\FormatConverter.
yii\helpers\BaseHtml
BaseHtml provides concrete implementation for yii\helpers\Html.
yii\helpers\BaseHtmlPurifier
BaseHtmlPurifier provides concrete implementation for yii\helpers\HtmlPurifier.
yii\helpers\BaseInflector
BaseInflector provides concrete implementation for yii\helpers\Inflector.
yii\helpers\BaseJson
BaseJson provides concrete implementation for yii\helpers\Json.
yii\helpers\BaseMarkdown
BaseMarkdown provides concrete implementation for yii\helpers\Markdown.
yii\helpers\BaseStringHelper
BaseStringHelper provides concrete implementation for yii\helpers\StringHelper.
yii\helpers\BaseUrl
BaseUrl provides concrete implementation for yii\helpers\Url.
yii\helpers\BaseVarDumper
BaseVarDumper provides concrete implementation for yii\helpers\VarDumper.
yii\helpers\Console
Console helper provides useful methods for command line related tasks such as getting input or formatting and coloring output.
yii\helpers\FileHelper
File system helper
yii\helpers\FormatConverter
FormatConverter provides functionality to convert between different formatting pattern formats.
yii\helpers\Html
Html provides a set of static methods for generating commonly used HTML tags.
yii\helpers\HtmlPurifier
HtmlPurifier provides an ability to clean up HTML from any harmful code.
yii\helpers\Inflector
Inflector pluralizes and singularizes English nouns. It also contains some other useful methods.
yii\helpers\Json
Json is a helper class providing JSON data encoding and decoding.
yii\helpers\Markdown
Markdown provides an ability to transform markdown into HTML.
yii\helpers\StringHelper
StringHelper
yii\helpers\Url
Url provides a set of static methods for managing URLs.
yii\helpers\VarDumper
VarDumper is intended to replace the buggy PHP function var_dump and print_r.
yii\i18n\DbMessageSource
DbMessageSource extends yii\i18n\MessageSource and represents a message source that stores translated messages in database.
yii\i18n\Formatter
Formatter provides a set of commonly used data formatting methods.
yii\i18n\GettextFile
GettextFile is the base class for representing a Gettext message file.
yii\i18n\GettextMessageSource
GettextMessageSource represents a message source that is based on GNU Gettext.
yii\i18n\GettextMoFile
GettextMoFile represents an MO Gettext message file.
yii\i18n\GettextPoFile
GettextPoFile represents a PO Gettext message file.
yii\i18n\I18N
I18N provides features related with internationalization (I18N) and localization (L10N).
yii\i18n\MessageFormatter
MessageFormatter allows formatting messages via ICU message format
yii\i18n\MessageSource
MessageSource is the base class for message translation repository classes.
yii\i18n\MissingTranslationEvent
MissingTranslationEvent represents the parameter for the yii\i18n\MessageSource::EVENT_MISSING_TRANSLATION event.
yii\i18n\PhpMessageSource
PhpMessageSource represents a message source that stores translated messages in PHP scripts.
yii\log\DbTarget
DbTarget stores log messages in a database table.
yii\log\Dispatcher
Dispatcher manages a set of log targets.
yii\log\EmailTarget
EmailTarget sends selected log messages to the specified email addresses.
yii\log\FileTarget
FileTarget records log messages in a file.
yii\log\Logger
Logger records logged messages in memory and sends them to different targets if $dispatcher is set.
yii\log\SyslogTarget
SyslogTarget writes log to syslog.
yii\log\Target
Target is the base class for all log target classes.
yii\mail\BaseMailer
BaseMailer serves as a base class that implements the basic functions required by yii\mail\MailerInterface.
yii\mail\BaseMessage
BaseMessage serves as a base class that implements the send() method required by yii\mail\MessageInterface.
yii\mail\MailEvent
MailEvent represents the event parameter used for events triggered by yii\mail\BaseMailer.
yii\mail\MailerInterface
MailerInterface is the interface that should be implemented by mailer classes.
yii\mail\MessageInterface
MessageInterface is the interface that should be implemented by mail message classes.
yii\mutex\DbMutex
DbMutex is the base class for classes, which relies on database while implementing mutex "lock" mechanism.
yii\mutex\FileMutex
FileMutex implements mutex "lock" mechanism via local file system files.
yii\mutex\Mutex
Mutex component allows mutual execution of the concurrent processes, preventing "race conditions".
yii\mutex\MysqlMutex
MysqlMutex implements mutex "lock" mechanism via MySQL locks.
yii\rbac\Assignment
Assignment represents an assignment of a role to a user.
yii\rbac\BaseManager
BaseManager is a base class implementing yii\rbac\ManagerInterface for RBAC management.
yii\rbac\DbManager
DbManager represents an authorization manager that stores authorization information in database.
yii\rbac\Item
yii\rbac\ManagerInterface
yii\rbac\Permission
yii\rbac\PhpManager
PhpManager represents an authorization manager that stores authorization information in terms of a PHP script file.
yii\rbac\Role
yii\rbac\Rule
Rule represents a business constraint that may be associated with a role, permission or assignment.
yii\rest\Action
Action is the base class for action classes that implement RESTful API.
yii\rest\ActiveController
ActiveController implements a common set of actions for supporting RESTful access to ActiveRecord.
yii\rest\Controller
Controller is the base class for RESTful API controller classes.
yii\rest\CreateAction
CreateAction implements the API endpoint for creating a new model from the given data.
yii\rest\DeleteAction
DeleteAction implements the API endpoint for deleting a model.
yii\rest\IndexAction
yii\rest\OptionsAction
OptionsAction responds to the OPTIONS request by sending back an Allow
header.
yii\rest\Serializer
Serializer converts resource objects and collections into array representation.
yii\rest\UpdateAction
UpdateAction implements the API endpoint for updating a model.
yii\rest\UrlRule
UrlRule is provided to simplify the creation of URL rules for RESTful API support.
yii\rest\ViewAction
ViewAction implements the API endpoint for returning the detailed information about a model.
yii\test\ActiveFixture
ActiveFixture represents a fixture backed up by a ActiveRecord class or a database table.
yii\test\ArrayFixture
ArrayFixture represents arbitrary fixture that can be loaded from PHP files.
yii\test\BaseActiveFixture
BaseActiveFixture is the base class for fixture classes that support accessing fixture data as ActiveRecord objects.
yii\test\DbFixture
DbFixture is the base class for DB-related fixtures.
yii\test\Fixture
Fixture represents a fixed state of a test environment.
yii\test\FixtureTrait
FixtureTrait provides functionalities for loading, unloading and accessing fixtures for a test case.
yii\test\InitDbFixture
InitDbFixture represents the initial state needed for DB-related tests.
yii\validators\BooleanValidator
BooleanValidator checks if the attribute value is a boolean value.
yii\validators\CompareValidator
CompareValidator compares the specified attribute value with another value.
yii\validators\DateValidator
DateValidator verifies if the attribute represents a date, time or datetime in a proper $format.
yii\validators\DefaultValueValidator
DefaultValueValidator sets the attribute to be the specified default value.
yii\validators\EachValidator
EachValidator validates an array by checking each of its elements against an embedded validation rule.
yii\validators\EmailValidator
EmailValidator validates that the attribute value is a valid email address.
yii\validators\ExistValidator
ExistValidator validates that the attribute value exists in a table.
yii\validators\FileValidator
FileValidator verifies if an attribute is receiving a valid uploaded file.
yii\validators\FilterValidator
FilterValidator converts the attribute value according to a filter.
yii\validators\ImageValidator
ImageValidator verifies if an attribute is receiving a valid image.
yii\validators\InlineValidator
InlineValidator represents a validator which is defined as a method in the object being validated.
yii\validators\NumberValidator
NumberValidator validates that the attribute value is a number.
yii\validators\PunycodeAsset
This asset bundle provides the javascript files needed for the yii\validators\EmailValidators client validation.
yii\validators\RangeValidator
RangeValidator validates that the attribute value is among a list of values.
yii\validators\RegularExpressionValidator
RegularExpressionValidator validates that the attribute value matches the specified $pattern.
yii\validators\RequiredValidator
RequiredValidator 驗證指定屬性不是空或null。
yii\validators\SafeValidator
SafeValidator serves as a dummy validator whose main purpose is to mark the attributes to be safe for massive assignment.
yii\validators\StringValidator
StringValidator 驗證屬性值符合一定長度。
yii\validators\UniqueValidator
UniqueValidator 驗證屬性值在指定數據庫表中是唯一的。
yii\validators\UrlValidator
UrlValidator 驗證屬性值是否為有效的http或https URL。
yii\validators\ValidationAsset
此資源包提供了客戶端驗證所需的js文件。
yii\validators\Validator
Validator 是所有驗證器類的基類。
yii\web\Application
Application是所有web應用程序類的基類。
yii\web\AssetBundle
AssetBundle 表示一組資源文件的集合, 如 CSS, JS, images.
yii\web\AssetConverter
AssetConverter supports conversion of several popular script formats into JS or CSS scripts.
yii\web\AssetConverterInterface
The AssetConverterInterface must be implemented by asset converter classes.
yii\web\AssetManager
AssetManager manages asset bundle configuration and loading.
yii\web\BadRequestHttpException
BadRequestHttpException represents a "Bad Request" HTTP exception with status code 400.
yii\web\CacheSession
CacheSession implements a session component using cache as storage medium.
yii\web\CompositeUrlRule
CompositeUrlRule is the base class for URL rule classes that consist of multiple simpler rules.
yii\web\ConflictHttpException
ConflictHttpException represents a "Conflict" HTTP exception with status code 409
yii\web\Controller
Controller is the base class of web controllers.
yii\web\Cookie
Cookie 表示一個cookie關聯的信息,如 $name, $value, $domain, 等等.
yii\web\CookieCollection
CookieCollection 保持當前請求中的cookies可用。
yii\web\DbSession
DbSession extends yii\web\Session by using database as session data storage.
yii\web\ErrorAction
ErrorAction 使用指定視圖顯示應用程序錯誤。
yii\web\ErrorHandler
ErrorHandler 處理未捕獲的錯誤和異常。
yii\web\ForbiddenHttpException
ForbiddenHttpException represents a "Forbidden" HTTP exception with status code 403.
yii\web\GoneHttpException
GoneHttpException represents a "Gone" HTTP exception with status code 410
yii\web\GroupUrlRule
GroupUrlRule represents a collection of URL rules sharing the same prefix in their patterns and routes.
yii\web\HeaderCollection
HeaderCollection is used by yii\web\Response to maintain the currently registered HTTP headers.
yii\web\HtmlResponseFormatter
HtmlResponseFormatter formats the given data into an HTML response content.
yii\web\HttpException
HttpException represents an exception caused by an improper request of the end-user.
yii\web\IdentityInterface
IdentityInterface is the interface that should be implemented by a class providing identity information.
yii\web\JqueryAsset
This asset bundle provides the jquery javascript library
yii\web\JsExpression
JsExpression marks a string as a JavaScript expression.
yii\web\JsonParser
Parses a raw HTTP request using yii\helpers\Json::decode()
yii\web\JsonResponseFormatter
JsonResponseFormatter formats the given data into a JSON or JSONP response content.
yii\web\Link
Link represents a link object as defined in JSON Hypermedia API Language.
yii\web\Linkable
Linkable is the interface that should be implemented by classes that typically represent locatable resources.
yii\web\MethodNotAllowedHttpException
MethodNotAllowedHttpException represents a "Method Not Allowed" HTTP exception with status code 405.
yii\web\MultiFieldSession
MultiFieldSession is the base class for session storage implementations with multi-field data storage support.
yii\web\NotAcceptableHttpException
NotAcceptableHttpException represents a "Not Acceptable" HTTP exception with status code 406
yii\web\NotFoundHttpException
NotFoundHttpException represents a "Not Found" HTTP exception with status code 404.
yii\web\Request
The web Request class represents an HTTP request
yii\web\RequestParserInterface
Interface for classes that parse the raw request body into a parameters array.
yii\web\Response
The web Response class represents an HTTP response
yii\web\ResponseFormatterInterface
ResponseFormatterInterface specifies the interface needed to format a response before it is sent out.
yii\web\ServerErrorHttpException
ServerErrorHttpException represents an "Internal Server Error" HTTP exception with status code 500.
yii\web\Session
Session provides session data management and the related configurations.
yii\web\SessionIterator
SessionIterator implements an iterator for traversing session variables managed by yii\web\Session.
yii\web\TooManyRequestsHttpException
TooManyRequestsHttpException represents a "Too Many Requests" HTTP exception with status code 429
yii\web\UnauthorizedHttpException
UnauthorizedHttpException represents an "Unauthorized" HTTP exception with status code 401
yii\web\UnprocessableEntityHttpException
UnprocessableEntityHttpException represents an "Unprocessable Entity" HTTP exception with status code 422.
yii\web\UnsupportedMediaTypeHttpException
UnsupportedMediaTypeHttpException represents an "Unsupported Media Type" HTTP exception with status code 415
yii\web\UploadedFile
UploadedFile represents the information for an uploaded file.
yii\web\UrlManager
UrlManager handles HTTP request parsing and creation of URLs based on a set of rules.
yii\web\UrlRule
UrlRule represents a rule used by yii\web\UrlManager for parsing and generating URLs.
yii\web\UrlRuleInterface
UrlRuleInterface is the interface that should be implemented URL rule classes.
yii\web\User
User is the class for the "user" application component that manages the user authentication status.
yii\web\UserEvent
This event class is used for Events triggered by the yii\web\User class.
yii\web\View
View represents a view object in the MVC pattern.
yii\web\ViewAction
ViewAction represents an action that displays a view according to a user-specified parameter.
yii\web\XmlResponseFormatter
XmlResponseFormatter formats the given data into an XML response content.
yii\web\YiiAsset
This asset bundle provides the base javascript files for the Yii Framework.
yii\widgets\ActiveField
ActiveField represents a form input field within an yii\widgets\ActiveForm.
yii\widgets\ActiveForm
ActiveForm is a widget that builds an interactive HTML form for one or multiple data models.
yii\widgets\ActiveFormAsset
yii\widgets\BaseListView
BaseListView is a base class for widgets displaying data from data provider such as ListView and GridView.
yii\widgets\Block
Block records all output between begin() and end() calls and stores it in yii\base\View::$blocks.
yii\widgets\Breadcrumbs
Breadcrumbs displays a list of links indicating the position of the current page in the whole site hierarchy.
yii\widgets\ContentDecorator
ContentDecorator records all output between begin() and end() calls, passes it to the given view file as $content
and then echoes rendering result.
yii\widgets\DetailView
DetailView displays the detail of a single data $model.
yii\widgets\FragmentCache
FragmentCache is used by yii\base\View to provide caching of page fragments.
yii\widgets\InputWidget
InputWidget is the base class for widgets that collect user inputs.
yii\widgets\LinkPager
LinkPager displays a list of hyperlinks that lead to different pages of target.
yii\widgets\LinkSorter
LinkSorter renders a list of sort links for the given sort definition.
yii\widgets\ListView
The ListView widget is used to display data from data provider. Each data model is rendered using the view specified.
yii\widgets\MaskedInput
MaskedInput generates a masked text input.
yii\widgets\MaskedInputAsset
The asset bundle for the yii\widgets\MaskedInput widget.
yii\widgets\Menu
Menu displays a multi-level menu using nested HTML lists.
yii\widgets\Pjax
Pjax is a widget integrating the pjax jQuery plugin.
yii\widgets\PjaxAsset
This asset bundle provides the javascript files required by yii\widgets\Pjax widget.
yii\widgets\Spaceless
Spaceless widget removes whitespace characters between HTML tags. Whitespaces within HTML tags or in a plain text are always left untouched.