Wiki

Articles in category "how-tos", sorted by commentsX
Displaying 141-150 of 341 result(s).

How to extend CFormatter, add i18n support to booleanFormat and use it in CDetailView

Created 3 years ago by c@cbaHow-tos3 comments – viewed 10,356 times – ( +9 ) – version 1.1
As you know, the CDetailView widget displays details of a single model. If no formatting is specified, boolean values that are stored in the database as 0 and 1, are represented in the detail view as 0 and 1. If formatted as boolean, they are represented as 'No' and 'Yes'. We want to add i18n support, so that Yes and No appear in the current language.

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

Created about a year ago by Gerhard LiebenbergHow-tos3 comments – viewed 14,569 times – ( +7 / -1 ) – version 1.1
Countries sometimes change their laws pertaining to timezones and daylight saving times. This means that GMT+2 can be a different time this August compared to last August! However, by using php's DateTime class (instead of timestamps), we can do both "format" and "timezone" conversions on a single DateTime object (only 2 lines of code) for date, time, timestamp and datetime types - while php takes care of nightmares such as current and historical timezones and daylight saving times.

Remove Byte Order Mark (BOM) from files recursively

Created about a year ago by Kostas Apazidis (KonApaz)How-tos3 comments – viewed 8,035 times – ( +5 / -1 ) – version all
Ok, this wiki is not only for yii projects.

Using loginRequiredAjaxResponse to solve ajax session timeout

Created 3 years ago by RutgerHow-tos3 comments – viewed 21,132 times – ( +13 ) – version 1.1
This solution requires Yii 1.1.9 or above

Use phing to make Yii application "installable"

Created 3 years ago by sensorarioHow-tos3 comments – viewed 7,877 times – ( +7 ) – version 1.1
To use this "how-to", you need to install phing in your machine.
tags: phing

Upload files in Yii2 with MongoDb and GridFs

Created about a year ago by edoardo849How-tos3 comments – viewed 10,713 times – ( +8 ) – version 2.0
Uploading files in a webapp can be extremely tricky and sometimes the quickest way to do it is to store the file directly in the webserver or into a DNS (like Amazon S3) and then to save the link and the metadata inside a table in the DB. The thing is that you'll have to deal with file permissions, server storage, file management and so on (which is perfectly fine, by the way).

Setting and getting systemwide static parameters

Created 4 years ago by Steve FriedlHow-tos3 comments – viewed 72,878 times – ( +11 ) – version 1.1
Occasionally one wishes to set systemwide parameters for an application, such as a contact address for email, an application name, or setting an option that guides major behavior. Yii provides for setting of static parameters in the configuration file, and this article talks about how to do it conveniently.
tags: config

Enforcing "You must agree" requirements in forms

Created 4 years ago by Steve FriedlHow-tos3 comments – viewed 18,294 times – ( +29 ) – version 1.1
Checkboxes have two possible values, true and false, but some applications require that the user select one particular value before proceeding. Examples might be:
tags: validation

Javascript and AJAX with Yii

Created 2 years ago by Fran├žois GannazHow-tos3 comments – viewed 109,635 times – ( +40 ) – version 1.1
This page intends to provide an exhaustive guide of how to use Javascript (JS) in Yii. It does not explain how to learn coding in JS, but how to deal with it "the Yii way".
tags: javascript, AJAX

Run an Yii Application inside an Wordpress page

Created 4 years ago by Paul ApostolHow-tos3 comments – viewed 21,261 times – ( +12 ) – version 1.1
Install a Wordpress site (mine is in "http://localhost/test/wordpress")