Wiki

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

yii2-app-advanced on single domain (Apache, Nginx)

Created about a year ago by MadAndHow-tos3 comments – viewed 44,756 times – ( +9 ) – version 2.0
If you develop rather complex applications with Yii2, you might already be familiar with yii2-app-advanced application template. Well, the template is awesome and provides high flexibility regarding code/configuration sharing among parts of an application.

Multiple CGridView virtual attributes, retrieved from a single model function. Also communication between CGridView columns and rows; and between CGridView and its own parent view.

Created about a year ago by Gerhard LiebenbergHow-tos3 comments – viewed 6,093 times – ( +1 ) – version 1.1
We probably have all used a virtual attribute (model function) to retrieve complex or related data for a CGridView column:

Secure password hashing with bCrypt

Created 4 years ago by waitforitHow-tos3 comments – viewed 23,264 times – ( +9 ) – version 1.1
In this article I will show you how to implement a secure password hashing mechanism in your Yii projects using a bCrypt class.

Load data from internal/external source to fill form fields

Created about a year ago by skwordenHow-tos3 comments – viewed 10,823 times – ( +1 ) – version 2.0
This wiki is to show you how to use jQuery get and JSON to get data from a dropdown/any form field and fill form fields with the values instantaneously. First, I'll give example use cases of what I'm going to teach you so you can quickly see if this is for you.

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

Created 4 years ago by c@cbaHow-tos3 comments – viewed 12,262 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 3 years ago by Gerhard LiebenbergHow-tos3 comments – viewed 19,801 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 time this August compared to last August! However, by using php's DateTime class (instead of timestamps), we can do both "format" and "time zone" 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 time zones and daylight saving times.

Remove Byte Order Mark (BOM) from files recursively

Created 3 years ago by Kostas Apazidis (KonApaz)How-tos3 comments – viewed 15,552 times – ( +5 / -1 ) – version all
Ok, this wiki is not only for yii projects.

Using loginRequiredAjaxResponse to solve ajax session timeout

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

Use phing to make Yii application "installable"

Created 4 years ago by sensorarioHow-tos3 comments – viewed 9,119 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 2 years ago by edoardo849How-tos3 comments – viewed 17,201 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).