I\'m trying to set an alias in Yii2 but I\'m getting a Invalid Parameter / Invalid path alias for the below code that is placed in the
To improve on @vitalik_74's answer
you can place it in config/web.php instead(if you are using the basic yii app, I'm not sure about the main config file in the advance version, but the same applies, just put the require on the main config file) so that it gets shorten to:
require(__DIR__ . '/aliases.php');