Seems like yiic has been removed for now, there are alternatives though, so read on.
It's all in the early stages, so the following method could break in the coming days/weeks/months. Therefore use with caution.
There are 2 ways to do this now:
Use composer. (I recommend this option.)
Directly copy the contents of yii2/apps/ directory to your apps directory, depending on the type of app you want to try.
There are currently 2 options for type of app - advanced, and basic. Both are in their respective directories within the yii2/apps/ directory, i.e yii2/apps/advanced and yii2/apps/basic.
For basic go through the basic readme.md, and for advanced go through the advanced readme.md.
The directions for using composer are given in the respective readme.md files. Including them here for completeness:
- Basic app:
- Install composer, if you don't have it.
- Use composer to install the app alongwith dependencies(Yii):
php path/to/composer.phar create-project --stability=dev yiisoft/yii2-app-basic my_yii2_trial
- Access app from
http://localhost/my_yii2_trial/www
- Advanced app:
- Install composer, if you don't have it.
- Use composer to install the app alongwith dependencies(Yii):
php path/to/composer.phar create-project --stability=dev yiisoft/yii2-app-advanced my_yii2_trial
- According to readme, after step 2 app should be accessible, but composer was failing(see issue 439). With schmunk's tip, ran the install or install.bat command that gets copied by composer:
./install
. Selected development environment (by entering choice0
in the instructions that show up when runninginstall
command).
Update: The command has been renamed toinit
, composer doesn't fail anymore, with fix from Qiang (check the issue 439 for more details). - Access app at:
http://localhost/my_yii2_trial/frontend/www
orhttp://localhost/my_yii2_trial/backstage/www
- Basic app:
Here's how to copy the directory and get it working:
Basic app:
- create your web-accessible directory for the app : my_yii2_trial
- copy all files and folders from yii2/apps/basic/ directory to my_yii2_trial/ directory.
- modify the my_yii2_trial/www/index.php file to point to the correct path for Yii.php. For me it was within yii2/framework/yii/
- comment the line that tries to include ../vendor/autoload.php file, I couldn't find that file anywhere,
so its probably for some future use.it is the autoloader provided by composer. - Access from browser :
http://localhost/my_yii2_trial/www
Advanced app:
- create your web-accessible directory for the app : my_yii2_trial
- copy all files and folders from yii2/apps/advanced/ directory to my_yii2_trial/ directory.
- modify the my_yii2_trial/frontend/www/index.php file to point to the correct path for Yii.php. Similarly modify backstage/www/index.php.
- comment the line that tries to include ../vendor/autoload.php file in both the index.php of backstage and frontend.
- Access app at:
http://localhost/my_yii2_trial/frontend/www
orhttp://localhost/my_yii2_trial/backstage/www
Some important links to read more about this: issue 77, issue 108, issue 131, and wiki comment.
I am not sure how composer's autoloader is being used, so can't comment on that. Also in future versions, backstage might be renamed to backend.