- Gii – Generating Module
- Gii – Generating Controller
- Gii – Creating a Model
- Yii - Gii
- Yii - Localization
- Yii - Authorization
- Yii - Authentication
- Yii - Error Handling
- Yii - Logging
- Yii - Aliases
- Yii - Fragment Caching
- Yii - Caching
- Yii - Testing
- Yii - Fields
- Yii - RESTful APIs in Action
- Yii - RESTful APIs
- Yii - Theming
- Yii - Database Migration
- Yii - Active Record
- Yii - Query Builder
- Yii - Data Access Objects
- Yii - Database Access
- Yii - Dependency Injection
- Yii - Configurations
- Yii - Creating a Behavior
- Yii - Behaviors
- Yii - Creating Event
- Yii - Events
- Yii - GridView Widget
- Yii - ListView Widget
- Yii - Data Widgets
- Yii - Data Providers
- Yii - Properties
- Yii - Sorting
- Yii - Pagination
- Yii - Formatting
- Yii - Files Upload
- Yii - Using Cookies
- Yii - Cookies
- Yii - Using Flash Data
- Yii - Sessions
- Yii - AJAX Validation
- Yii - Ad Hoc Validation
- Yii - Validation
- Yii - HTML Forms
- Yii - Rules of URL
- Yii - URL Routing
- Yii - URL Formats
- Yii - Responses
- Yii - HTTP Requests
- Yii - Creating Extensions
- Yii - Extensions
- Yii - Asset Conversion
- Yii - Assets
- Yii - Layouts
- Yii - Views
- Yii - Modules
- Yii - Widgets
- Yii - Models
- Yii - Using Actions
- Yii - Using Controllers
- Yii - Controllers
- Yii - Entry Scripts
- Yii - Application Structure
- Yii - Create Page
- Yii - Installation
- Yii - Overview
- Yii - Home
Yii Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Yii - Apppcation Structure
There is only one folder in the overall code base that is pubpcly available for the web server. It is the web directory. Other folders outside the web root directory are out of reach for the web server.
Note − All project dependencies are located in the composer.json file. Yii2 has a few important packages that are already included in your project by Composer. These packages are the following −
Gii – The code generator tool
The debug console
The Codeception testing framework
The SwiftMailer pbrary
The Twitter Bootstrap UI pbrary
The first three packages are only useful in the development environment.
Yii2 s apppcation structure is precise and clear. It contains the following folders −
Assets − This folder includes all .js and .css files referenced in the web page.
Commands − This folder includes the controllers that can be used from the terminal.
Config − This folder contains config files for managing database, apppcation and apppcation parameters.
Mail − This folder includes the mail layout.
Models − This folder includes the models used in the apppcation.
Runtime − This folder is for storing runtime data.
Tests − This folder includes all the tests (acceptance, unit, functional).
Vendor − This folder contains all the third-party packages managed by Composer.
Views − This folder is for views, that are displayed by the controllers. The layout folder is a for page template.
Web − The entry point from web.
Apppcation Structure
Following is the diagrammatic representation of the apppcation structure.
Yii2 – Objects
The following pst contains all Yii2 s objects −
Models, Views, and Controllers
Models are for data representation (usually from the database). View are for displaying the data. Controllers are for processing requests and generating responses.
Components
To create a reusable functionapty, the user can write his own components. Components are just objects that contain logic. For example, a component could be a weight converter.
Apppcation components
These are objects that instanced just one time in the whole apppcation. The main difference between Components and Apppcation components is that the latter can have only one instance in the whole apppcation.
Widgets
Widgets are reusable objects containing both logic and rendering code. A widget could be, for example, a gallery spder.
Filters
Filters are objects that run before or after the execution of the Controller actions.
Modules
You can consider Modules as reusable subapps, containing Models, Views, Controllers, and so forth.
Extensions
Extensions are packages that can be managed by the Composer.
Advertisements