Wiki

Articles in category "how-tos", sorted by viewsX
Displaying 21-30 of 189 result(s).

Implementing cron jobs with Yii

Created 2 years ago by samdarkHow-tos4 comments – viewed 30,444 times – ( +26 / -1 )
There are two ways to run a cron job:
tags: cron, cli

How to log and debug variables using CWebLogRoute

Created 2 years ago by Antonio RamirezHow-tos4 comments – viewed 30,093 times – ( +13 )
I have seen a couple of articles about how to integrate external libraries to debug our PHP code (i.e. firePHP) but after you read this article you will realize that there is no need for such libraries when using Yii.
tags: Logging

Using Yii with Nginx and PHP-FPM

Created 2 years ago by LericHow-tos10 comments – viewed 26,727 times – ( +17 )
This config is built on an Ubuntu 11.04 server. Software is nginx, php-fpm (php5-fpm). For performance, it's recommended to run php-fpm in SOCKET mode, instead of accessing via IP:PORT. That is the method shown below.

Model password confirmation field.

Created about a year ago by twisted1919How-tos5 comments – viewed 25,925 times – ( +7 )
I had some troubles with the password confirmation field for when adding updating user records, so i thought that i should share the way i got it working.

Using filters with CGridView and CArrayDataProvider

Created about a year ago by marcovtwoutHow-tos12 comments – viewed 25,730 times – ( +12 )
Using filters on CGridView with CActiveDataProvider is easy, but with CArrayDataProvider it is a bit tricky.

How to translate and do the translations the easy way

Created about a year ago by Roman SolomatinHow-tos3 comments – viewed 25,492 times – ( +17 / -1 )
I wanted to keep all the I18N related translations in separate files, so that I would not need to modify the view files or the model files every time I need to update or fix the translations of application's source language.
tags: i18n

Moving project code outside of webroot (plus multiple project support)

Created 2 years ago by Steve FriedlHow-tos5 comments – viewed 25,111 times – ( +22 / -1 )
Yii's by-default directory organization works well enough, but there are several steps one can take that improve the security and serviceability of the system, especially in the context of multiple Yii projects on the same machine (including multiple versions of the same project).
tags: config, security

How to use single form to collect data for two or more models (CActiveForm and Ajax Validation edition)

Created about a year ago by RusAlexHow-tos8 comments – viewed 24,640 times – ( +16 )
With Yii you can use one CActiveForm for collecting data for two or more models with ajax validation and client validation.

Displaying image in a CGridView column.

Created about a year ago by sirin kHow-tos5 comments – viewed 24,309 times – ( +12 / -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

X-Sendfile - serve large static files efficiently from web applications

Created 2 years ago by Maurizio DombaHow-tos5 comments – viewed 24,088 times – ( +24 )
Normally when we want users to download a file, that file is put in a folder under the web application root and the web server does the rest.