Working with scenarios, with models that can receive many modifications in their rules or structures as development evolves, can create disruptions in the rescue process.
Working with scenarios, with models that can receive many modifications in their rules or structures as development evolves, can create disruptions in the rescue process.
This tutorial shows you how to safely remove records between relationships.
Ok, it is a little bit difficult to full understanding the unsafe validator.
It is convenient to use the same identification attribute, say info
, in all of the active records of your application. It should be a virtual read-only attribute defined by a getter method, its label being the model name.
I just chased my tail around for a bit today. I got lost with setting the status of all inputs, and banging my head on why the "validate" function just wasn't working.
One of the common tasks the web application might be required to perform, especially the app using some kind of a CMS, is to save the history of data changes. Your client for sure will want the answer to this simple question - If I mess this up or delete by accident can we bring it back? Well, DB backup is one thing and quick recovery is another - let's talk about latter one.
There are cases that model validators should be depended by controller/action and you couldn't manipulate on the model class or using scenarios in easy way
In yii2 we can create form without create FormModel. Here we go
Efficient coding with Yii implies efficient use of the code generator. This article shares the personalised Gii templates that were built starting from the standard templates proposed by AweGen.
Suppose you have Products,Categories and each product belongs in many categories
The yii2-field-range extension enables you to easily setup ActiveField range fields with Bootstrap styling. You basically can setup two attributes joined together like a single field with combined validation error block.
In this wiki I will show you how to save/update a model with many related model For example: How to set a product to multiple categories only in one post form ?
CGridview displays existent rows of the table (using DataProvider)
Suppose we want to set a category to product (or an item in general term), Also suppose categories has sub-categories (multi-level)
Everyone have seen a multilayer menu in several CMS
Note the tag {{homeUrl}}
will be dynamically replaced at runtime.
There are cases you want to update a record on CGridview directly
There are cases that you want to validate the file format, size, extension etc but how to do that without submit the form ?
Suppose you have an Application in Yii that manages hotels each one has many customers.
This is a reference to be used for Model rule validation and is compiled from the Yii documentation and code. The purpose is to have all the information gathered in one place instead of scattered. This reference is not an intro. See The Definitive Guide to Yii, Declaring Validation Rules for a tutorial.