Flash data is a kind of session data, which possesses the following features. Set in one request. Only available during the next request. Automatically deleted afterwards. It is mainly used to deliver messages to the end users that is delivered ...

Sessions allow us to get access to data across various pages for each user request. A file is created in a temporary directory on the server by session to store all session variables. This stored data is available to all ...

To delete records in the database, following these steps. We have named our Yii2 folder as delete. Step 1 Create Model file Create a model file child.php in frontend/models folder. Step 2 Create action in controllers Create an action actionDelete ...

To update the records in the database, following these steps. We have named our Yii2 folder as update. Step 1 Create Model file Create a model file child.php in frontend/models folder. Step 2 Add action in controllers Add the update ...

Now we’ll fetch the data from our table child. Here our Yiii2 folder is named as read. Step 1 Create Model file Create a model file child.php in frontend/models folder. Step 2 Add action to read In the ChildController.php file, ...

To insert the records in the database, following steps are there. We have named our Yii2 folder as create. Step 1 Create Model file Create a model file child.php in frontend/models folder. Look at the above code, \yii\db\ActiveRecord is used ...

Earlier we performed CRUD operation with yii’s Gii generating tool. Now we’ll perform CRUD without Gii. We’ll perform a complete CRUD operation here. The name of our Yii2 folder is dbb. We have created a database named student and a ...

To validate values that are not bound to any model, we need to use ad hoc validation. Or if you want to validate values without models then use ad hoc validation. To perform one type of validation, you may call ...

We’ll create a form to get the data from users. In our form, we’ll create four input fields for name, contact, course and email. Page will display the entered values back. Step 1 Create Model file UserForm.php Here we’ll create ...

Widgets are reusable building blocks on client-side (containing JavaScript, HTML and CSS). They are used to create complex and configurable user interface elements in views. For example, a Progress widget and DatePicker widget can create a progress bar and stylist ...