Wiki

Articles in category "how-tos", sorted by date (updated)X
Displaying 1-10 of 354 result(s).

Write & use a custom Component in Yii2.0

Updated 3 days ago by sirin kHow-tos5 comments – viewed 61,790 times – ( +18 ) – version 2.0
This is a simple example in Yii2.0 to understand how you can write a custom component and use it inside your app.(basic template)

Storing your images in your table's blob field and displaying that stored images.

Updated 3 days ago by sirin kHow-tos7 comments – viewed 33,007 times – ( +9 / -1 ) – version 1.1
He im giving you a very simple example ie how you can store an image to your blob field in a table.Hope you already familiar with the normal image upload.
tags: blob, image

Displaying image in a CGridView column.

Updated 3 days ago by sirin kHow-tos5 comments – viewed 62,063 times – ( +13 / -1 ) – version 1.1
This is a simple example of how we can display images in CGridviews.Imagine that you have an image field in your table ie either a location field or a blob type field used to store the images.
tags: CGridView, image

How to make UrlManager createAbsoluteUrl work with sub-domains

Updated 12 days ago by Wade ShulerHow-tos0 comments – viewed 971 times – version 2.0
Upon creating my Yii2 Members System, I have ran into a few snags along the way that forced me to extend and bend Yii2 to my will.

i18n All-in-one format and timezone conversions for date, time, timestamp and datetime.

Updated about a month ago by Gerhard LiebenbergHow-tos3 comments – viewed 20,831 times – ( +8 / -1 ) – version 1.1
Countries sometimes change their laws pertaining to time zones and daylight saving times. This means that GMT+2 can be a different local time this August compared to last August! It could even be a different date!

Using loginRequiredAjaxResponse to solve ajax session timeout

Updated 3 months ago by RutgerHow-tos3 comments – viewed 26,679 times – ( +13 ) – version 1.1
This solution requires Yii 1.1.9 or above

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

Updated 4 months ago by mrunHow-tos2 comments – viewed 14,590 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.

Interactive mode command-line command for Yii1

Updated 5 months ago by TrejderHow-tos0 comments – viewed 4,701 times – version 1.1
For one of my projects I needed an interactive console command in Yii 1, i.e. the one that is gathering all information from user in an interactive mode (a serie of questions and answers displayed directly in the console), ignoring command-line arguments at all.

How to customize your grid columns visible and order by user themselves

Updated 6 months ago by Scott_HuangHow-tos0 comments – viewed 3,999 times – ( +1 ) – version 1.1
Cusomized your grid columns by user themselves, allow user to hide/show columns or re-order the columns sequences.

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

Updated 7 months ago by brianvuHow-tos4 comments – viewed 21,150 times – ( +4 / -6 ) – version 1.1
Ok, it is a little bit difficult to full understanding the unsafe validator.