Wiki

Articles in category "tutorials", sorted by ratingX
Displaying 71-80 of 241 result(s).

How to store array/widget configuration to the database with config validation rules

Created about a year ago by Kartik VTutorials0 comments – viewed 3,488 times – ( +38 / -4 ) – version 2.0
You may have scenarios, where you want to store a specific array configuration to the database. A classic example could be saving Yii widget configuration to the database and then retrieving it at runtime, with dynamic parameters set. This wiki discusses one of the approaches to do this. Let's consider you have something like the NavBar configuration below to store in the db:

Filter & Sort by Summary Data in GridView Yii 2.0

Created about a year ago by Kartik VTutorials6 comments – viewed 12,604 times – ( +38 / -4 ) – version 2.0
This wiki explains how to add summary data from related models into your Yii Framework 2.0 gridview with filtering and sorting by the summary columns.

How to create a breadcrumb widget

Created 6 years ago by knutTutorials4 comments – viewed 61,757 times – ( +13 ) – version 1.1
Here's a simple way to create a breadcrumb widget to be used in your templates. The idea is just to isolate how the breadcrumb is generated based on an array of crumbs.

Simplified meta tags

Created 5 years ago by Y!!Tutorials4 comments – viewed 34,122 times – ( +13 ) – version 1.1
If we want to set meta tags on a per page (controller-action) basis, we may use the clientScript application component.

Handling tabular data loading and validation in Yii 2

Created about a year ago by Kartik VTutorials3 comments – viewed 11,112 times – ( +41 / -5 ) – version 2.0
How do you read and handle tabular data submission via form in Yii framework 2.0? Sometimes we want to collect user input in a batch mode. That is, the user can enter the information for multiple model instances and submit them all at once. We call this tabular input because the input fields are often presented in an HTML table.

How to create/save more Model inputs and make them repeatable with jQuery

Created 6 years ago by qiangTutorials3 comments – viewed 35,971 times – ( +12 ) – version 1.1
This is the first real problem that I encountered using Yii, trying to make a Model input repeatable in the form, validate and save them.

i18n for your model in just 1 line

Created 5 years ago by mintaoTutorials0 comments – viewed 12,089 times – ( +12 ) – version 1.1
A simple trick to get the localized version of a model field is to add this little method to your models.
tags: i18n

Managing your nested dropdown dependency with DepDrop widget

Created about a year ago by Kartik VTutorials6 comments – viewed 7,516 times – ( +37 / -5 ) – version 2.0
If you are coming over to Yii 2 from Yii 1.x, you may have already read this useful wiki for creating dependent dropdowns. You can use a similar approach in Yii 2 to do the same. But if you are looking at a prebuilt solution that helps you manage it easier, read along.

What to do when composer fails to update your vendor packages?

Created about a year ago by Kartik VTutorials0 comments – viewed 4,677 times – ( +36 / -5 ) – version 2.0
Have you faced some of these problems when using composer with your Yii 2 installation?

How to customize the error message of a validation rule

Created 6 years ago by qiangTutorials4 comments – viewed 70,846 times – ( +17 / -1 ) – version 1.1
Validators extending from CValidator all have a property named message. You can set this property in the corresponding validation rule to customize the error message. For example, the following validation rule uses an error message that is different from the default one: