Application properties

A Yii2 application can be configured through several properties.

The properties that need to be configured in any application are listed in the following table:

Properties

Description

id

This indicates a unique ID to distinguish this application from others. It is mainly used programmatically. An example of this property is basic.

basePath

This specifies the root directory of the application. This path is the starting point for all the other types of application objects, such as models, controllers, and views. An example of this property is dirname(__DIR__).

The other common properties are listed in the following table:

Properties

Description

aliases

This indicates an alias name for path definitions. They are ...

Get Yii2 By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.