Customize default yii application structure

To create yii application, command is ./yiic/webapp app-name.
Application is generated under framework folder and it is as per default yii defined structure.
This guide is to customize the structure of default Yii application generation.

The default webapplication created is copy of  yii/framework/cli/views/webapp.
To customize it, one can change it directly, but it is not recommended way.
We should make a copy of it and save as different name like mywebapp.
New copy should be in same folder  yii/framework/cli/views.
Make all changes as per your file structure and change in code, add components,theme for your application in it.

Open webappcommand.php file from   yii/frameworkcli/commands.
We need to change SourceDir name to our new name.Change following line in code
$sourceDir=realpath(dirname(__FILE__).’/../views/webapp’);
to
$sourceDir=realpath(dirname(__FILE__).’/../views/mywebapp’);

Now our new yii web application structure is ready.
Run ./yiic webapp app-name,& It will make a application as per your changes.
You can generate application yii default or customize by changing source directory in webappcommand.php file.
Start customizing it!!!
All the best!!!
Have a good day!!!