You can install yii2 with composer by this command
composer create-project --prefer-dist yiisoft/yii2-app-basic YOUR_DIRECTORY_NAME

BY Best Interview Question ON 01 Feb 2019