Please guide me about the hierarchy of Yii Framework i.e in which directory do we put html, css, javascript files and associate them with each other.
You may check the documentation (http://www.yiiframework.com/wiki/155/the-directory-structure-of-the-yii-project-site/)
To answer your question:
backend: the backend application which is mainly used site administrators to manage the whole system.
frontend: the frontend application which provides the main interfaces to our target end users.
console: the console application that consists of the console commands needed by the system.
common: the directory whose content are shared among the above applications. As we can see, we divide the whole system into three applications: backend, frontend and console. If needed, we can add more applications (e.g. api, to provide Web API service). We use common to store files that are shared among the applications.
As you have tagged the question with Yii2 as well, here is the typical directory strucuture of Yii2 Advanced Template:
https://github.com/yiisoft/yii2-app-advanced/blob/master/docs/guide/structure-directories.md
Directories
The root directory contains the following subdirectories:
backend
- backend web application.
common
- files common to all applications.
console
- console application.
environments
- environment configs.
frontend
- frontend web application.Root directory contains a set of files.
.gitignore
contains a list of directories ignored by git version system. If you need something never get to your source code repository, add it there.
composer.json
- Composer config described in Configuring Composer.
init
- initialization script described in Configuration and environments.
init.bat
- same for Windows.
LICENSE.md
- license info. Put your project license there. Especially when opensourcing.
README.md
- basic info about installing template. Consider replacing it with information about your project and its installation.
requirements.php
- Yii requirements checker.
yii
- console application bootstrap.
yii.bat
- same for Windows.There are three applications in advanced template: frontend, backend and console. Frontend is typically what is presented to end user, the project itself. Backend is admin panel, analytics and such functionality. Console is typically used for cron jobs and low-level server management. Also it's used during application deployment and handles migrations and assets.
There's also a
common
directory that contains files used by more than one application. For example,User
model.Frontend and backend are both web applications and both contain the
web
directory. That's the webroot you should point your web server to.Each application has its own namespace and alias corresponding to its name. Same applies to the common directory.
The css, js for frontend or backend application is generally stored inside the corresponsing web/
folder.
I use follow strukture:
All install/update by composer.In config directory set specific configuration. Can setup unlimeted www.