Wiki

Articles tagged with "model", sorted by ratingX
Displaying 11-20 of 28 result(s).

Managing constants easily

Created 5 years ago by briiC.lvTips4 comments – viewed 16,429 times – ( +4 / -1 ) – version 1.1
For time to time i have models with constants (basicly status constants) which i use in diferent places and if these constant changes, i have to change mentions of constant in code elsewhere.

ClientValidation for files (modern browsers)

Created 3 years ago by Kostas Apazidis (KonApaz)How-tos0 comments – viewed 10,085 times – ( +4 / -1 ) – version 1.1
There are cases that you want to validate the file format, size, extension etc but how to do that without submit the form ?

model rules depended by user roles-permissions

Created 4 years ago by Kostas Apazidis (KonApaz)How-tos0 comments – viewed 10,634 times – ( +3 / -1 )
This is a reference about model validators and user roles. In many cases we want model validators to applied only for some privileged users or not

Expert's model generation with Gii

Created 2 years ago by le_topTips0 comments – viewed 8,555 times – ( +3 / -1 ) – version 1.1
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.

Inline views, write less

Created 4 years ago by FirebreakerTips0 comments – viewed 6,444 times – ( +3 / -1 )
Sometimes writing views like

Active Record snapshotting (Model data base history)

Created 2 years ago by BizleyTutorials3 comments – viewed 7,080 times – ( +2 / -1 ) – version 1.1
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.

Insert a model record using CGridview

Created 3 years ago by Kostas Apazidis (KonApaz)How-tos0 comments – viewed 9,663 times – ( +2 / -1 ) – version 1.1
CGridview displays existent rows of the table (using DataProvider)

Sort and save order of model-elements drag & drop

Created 3 years ago by Kostas Apazidis (KonApaz)Tutorials2 comments – viewed 7,821 times – ( +2 / -1 ) – version 1.1
Suppose you have Products,Categories and each product belongs in many categories

Create Form With DynamicModel

Created 2 years ago by Misbahul D MunirTips4 comments – viewed 16,061 times – ( +2 / -1 ) – version 2.0
In yii2 we can create form without create FormModel. Here we go
tags: form, yii2, model

"safe" and "unsafe" Model validators (massive assignments)

Created 3 years ago by Kostas Apazidis (KonApaz)How-tos4 comments – viewed 21,650 times – ( +4 / -7 ) – version 1.1
Ok, it is a little bit difficult to full understanding the unsafe validator.