Wiki

Sorted by viewsX
Displaying 471-480 of 777 result(s).

How to implement form events

Created 2 years ago by Antonio RamirezHow-tos4 comments – viewed 13,384 times – ( +6 ) – version 2.0
You have that, when a product is on development they can change its API anytime. This change is quite important though, its related on how to set the events of your form, for example, the useful beforeSubmit.
tags: yii2, forms, how to

[Updated] How to create & call custom global function in whole application?

Created 2 years ago by Rohit SutharTutorials8 comments – viewed 13,303 times – ( +5 / -2 ) – version 1.1
In this wiki I will show how to create own custom global function. It may be save the space and reduce the time.

Simple way to implement Dynamic Tabular Inputs

Created about a year ago by ezekielnoobTutorials5 comments – viewed 13,205 times – ( +4 ) – version all

AutoTimestampBehavior

Created 7 years ago by jonahTutorials1 comment – viewed 13,202 times – ( +2 / -2 ) – version 1.1
Note: currently a variant of this class CTimestampBehavior is included into Yii distribution package.

i18n for your model in just 1 line

Created 6 years ago by mintaoTutorials0 comments – viewed 13,196 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

How to "masquerade" a non-required form element as 'required' one (in the view only)

Created 4 years ago by BoazHow-tos2 comments – viewed 13,195 times – ( +7 / -1 ) – version 1.1
In a nutshell, the task at hand is to mark (or render) a model attribute in the typical "_form.php" view file with the 'required' red asterisk while this attribute is not marked as required in the model's rule() method. If you're interested only in the solution, jump ahead to the 'solution' section below.

Alternative folder structure for a standard Yii app

Created 3 years ago by TrejderHow-tos4 comments – viewed 13,185 times – ( +5 ) – version 1.1
I found a standard Yii app's protected folder structure nearly perfect. With a few simple moves and a little bit change to the code, I managed to bring it to the level, which I found as fully perfect. I want to share my point of view, in case someone would like to use this structure as well.

Adding 'disabled' to CCheckBoxColumn and support for yiigridview.js

Created 3 years ago by Xgamer99Tips3 comments – viewed 13,153 times – ( +1 ) – version 1.1
I recently had to have a checkbox column in my grid view that supported the 'disabled' attribute. This was easy enough to do by extending the CCheckBoxColumn. However, I also wanted the checkbox to be selected when clicking on the table's row (supported via CGridView's selectableRows option). I discovered I had to tweak yiigridview.js so that it would not select disabled rows when clicking on it or on the 'select all' checkbox.

Integrating FirePHP

Created 5 years ago by ricardogranaTutorials5 comments – viewed 13,050 times – ( +8 ) – version 1.1
Install Firebug plugin for Firefox from here.

Key web server settings after installing a fresh Yii 2 basic or advanced app

Created 2 years ago by Kartik VTips2 comments – viewed 13,021 times – ( +48 ) – version 2.0
So, you have installed a brand new Yii 2 app (basic) or (advanced). Here are a few tips for Apache web server users to get things running more secure and better with your yii2 app.