web\Request $isOptions

$isOptions public read-only property Whether this is a OPTIONS request. public boolean getIsOptions ( )

grid\GridView initColumns()

initColumns() protected method Creates column objects and initializes them. protected void initColumns ( )

web\Session $allFlashes

$allFlashes public read-only property Flash messages (key => message or key => [message1, message2]). public array getAllFlashes ( $delete = false )

helpers\BaseHtml activeRadioList()

activeRadioList() public static method Generates a list of radio buttons. A radio button list is like a checkbox list, except that it only allows single selection. The selection of the radio buttons is taken from the value of the model attribute. public static string activeRadioList ( $model, $attribute, $items, $options = [] )$model yii\base\Model The model object $attribute string The attribute name or expression. See getAttributeName() for the format about attribute expression. $it

gii\generators\crud\Generator rules()

rules() public method Returns the validation rules for attributes. Validation rules are used by validate() to check if attribute values are valid. Child classes may override this method to declare different validation rules. Each rule is an array with the following structure: [ ['attribute1', 'attribute2'], 'validator type', 'on' => ['scenario1', 'scenario2'], //...other parameters... ] where attribute list: required, specifies the attributes array to be validated, for s

Routing and URL Creation

URL Formats Routing Creating URLs Using Pretty URLs Performance Consideration When a Yii application starts processing a requested URL, the first step it takes is to parse the URL into a route. The route is then used to instantiate the corresponding controller action to handle the request. This whole process is called routing. The reverse process of routing is called URL creation, which creates a URL from a given route and the associated query parameters. When the created URL is later requeste

bootstrap\InputWidget

All Classes | Properties | Methods Inheritance yii\bootstrap\InputWidget » yii\widgets\InputWidget » yii\base\Widget » yii\base\Component » yii\base\Object Implements yii\base\Configurable, yii\base\ViewContextInterface Uses Traits yii\bootstrap\BootstrapWidgetTrait Subclasses yii\bootstrap\ToggleButtonGroup Available since version 2.0.6 Source Code https://github.com/yiisoft/yii2-bootstrap/blob/master/InputWidget.php InputWidget is an adjusted for bootstrap needs version of yii\widget

Controllers

Actions Routes Creating Controllers Creating Actions Controller Lifecycle Best Practices Controllers are part of the MVC architecture. They are objects of classes extending from yii\base\Controller and are responsible for processing requests and generating responses. In particular, after taking over the control from applications, controllers will analyze incoming request data, pass them to models, inject model results into views, and finally generate outgoing responses. Actions Controllers a

Internationalization

Locale and Language Message Translation Message Formatting View Translation Formatting Date and Number Values Setting Up PHP Environment 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 because the potential users may be worldwide. Yii offers a full spectrum of I18N features that support message translation, view tra

Query Builder

Building Queries Query Methods Built on top of Database Access Objects, query builder allows you to construct a SQL query in a programmatic and DBMS-agnostic way. Compared to writing raw SQL statements, using query builder will help you write more readable SQL-related code and generate more secure SQL statements. Using query builder usually involves two steps: Build a yii\db\Query object to represent different parts (e.g. SELECT, FROM) of a SELECT SQL statement. Execute a query method (e.g. a