Yii 2 seeded path aliases with default basic and advanced app

If you are coming over from Yii 1.x to Yii 2, you must have already read this guide. You should note that namespaces are very important in Yii 2 to identify classes. But do you know the list of seeded path aliases that come shipped with a basic or advanced app? Here is an attempt to list them.

Path Aliases List

Yii2 Basic App

  • @app: Your application root directory
  • @vendor: Your vendor directory under @app
  • @runtime: Your application files runtime/cache storage folder
  • @web: Your application base url path
  • @webroot: Your application web root
  • @tests: Your console tests directory

Yii2 Advanced App

  • @app: Your application root directory
  • @vendor: Your vendor directory under @app
  • @runtime: Your application files runtime/cache storage folder
  • @web: Your application base url path
  • @webroot: Your application web root
  • @tests: Your console tests directory
  • @common: Alias for your common root folder under @app
  • @frontend: Alias for your frontend root folder under @app
  • @backend: Alias for your backend root folder under @app
  • @console: Alias for your console root folder under @app