Gii – Creating a Model
To create a Model in Gii − <?php namespace app\models; use app\components\UppercaseBehavior; use Yii; /** * This is the model class for table "user". * * @property integer $id *…
To create a Model in Gii − <?php namespace app\models; use app\components\UppercaseBehavior; use Yii; /** * This is the model class for table "user". * * @property integer $id *…
Gii is the extension, that provides a web-based code generator for generating models, forms, modules, CRUD, and so forth. By default, the following generators are available − Model Generator − Generates…
I18N (Internationalization) is the process of designing an application that can be adapted to various languages. Yii offers a full spectrum of I18N features. Locale is a set of parameters that…
The process of verifying that a user has enough permission to do something is called authorization. Yii provides an ACF (Access Control Filter), an authorization method implemented as yii\filters\AccessControl. Modify the behaviors()…
The process of verifying the identity of a user is called authentication. It usually uses a username and a password to judge whether the user is one who he claims as.…
Yii includes a built-in error handler. The Yii error handler does the following − Converts all non-fatal PHP errors into catchable exceptions.Displays all errors and exceptions with a detailed call…
Yii provides a highly customizable and extensible framework. With the help of this framework, you can easily log various types of messages. To log a message, you should call one…
Aliases help you not to hard-code absolute paths or URLs in your project. An alias starts with the @ character. To define an alias you should call the Yii::setAlias() method − //…
Fragment caching provides caching of a fragment of a web page. Step1 − Add a new function called actionFragmentCaching() to the SiteController. public function actionFragmentCaching() { $user = new MyUser(); $user->name = "cached…
Caching is an effective way to improve the performance of your application. Caching mechanisms store static data in cache and get it from cache when requested. On the server side,…