====== Unterschiede ====== Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
| — |
aliase_pfad [2020/05/25 18:57] (aktuell) jonas angelegt |
||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| + | ====== Aliase / Pfad ====== | ||
| + | |||
| + | |||
| + | <code php> | ||
| + | @yii, the directory where the BaseYii.php file is located (also called the framework directory). | ||
| + | @app, the base path of the currently running application. | ||
| + | @runtime, the runtime path of the currently running application. Defaults to @app/runtime. | ||
| + | @webroot, the Web root directory of the currently running Web application. It is determined based on the directory containing the entry script. | ||
| + | @web, the base URL of the currently running Web application. It has the same value as yii\web\Request::$baseUrl. | ||
| + | @vendor, the Composer vendor directory. Defaults to @app/vendor. | ||
| + | @bower, the root directory that contains bower packages. Defaults to @vendor/bower. | ||
| + | @npm, the root directory that contains npm packages. Defaults to @vendor/npm. | ||
| + | </code> | ||
| + | |||
| + | <code php> | ||
| + | // Beispiel | ||
| + | echo Yii::getAlias('@webroot'); | ||
| + | |||
| + | // Alias setzen: | ||
| + | echo Yii::setAlias('@anyname'); | ||
| + | </code> | ||
| + | |||
| + | https://www.yiiframework.com/doc/guide/2.0/en/concept-aliases | ||