Wiki

Articles in category "how-tos", sorted by viewsX
Displaying 11-20 of 301 result(s).

Uploading multiple images with CMultiFileUpload

Created 3 years ago by rsinghHow-tos16 comments – viewed 71,943 times – ( +37 ) – version 1.1
"The documentation for CMultiFileUpload isn't clear!"

Accessing data in a join table with the related models

Created 2 years ago by fsbHow-tos8 comments – viewed 65,679 times – ( +26 / -1 ) – version 1.1
Sometimes the right place to store application data is in a join table. For example, movie viewers either like or don’t like the movies they watched.

Multiple-database support in Yii

Created 3 years ago by Steve FriedlHow-tos14 comments – viewed 63,343 times – ( +28 ) – version 1.1
The customary configuration of a Yii application includes just a single database section in the protected/config/main.php file, but it's easy to extend this to support more than one, tying each Model to one of the databases.
tags: Database

Creating a CSS Driven Drop Down Menu using CMenu

Created 3 years ago by blindMoeHow-tos9 comments – viewed 62,510 times – ( +21 / -1 ) – version 1.1
CMenu offers great functionality and the ability to customize just about every aspect of the output. There are many times when I need to create a drop down menu or simply modify the look to make the designers happy. Because this seems to be a common task for me, I figured I would share my code to create a very simple drop down menu that other people could use.

How to set up Unicode

Created 5 years ago by MikeHow-tos10 comments – viewed 59,584 times – ( +18 ) – version 1.1
To fix issues with display of special language characters once and for all there's a solution: use Unicode UTF-8 everywhere. If everything is set up to use Unicode, you can use mostly every language in your application.
tags: i18n, unicode

How to use PHPExcel external library with Yii

Created 3 years ago by Antonio RamirezHow-tos13 comments – viewed 57,029 times – ( +28 / -1 ) – version 1.1
Trying to learn and help some other programmers to find their solutions on the Yii Forum (I think is a superb way to learn the framework), I was facing one challenge with an external library that a fellow programmer wanted to use -quite good indeed: PHPExcel. And what is PHPExcel?

Setting and getting systemwide static parameters

Created 3 years ago by Steve FriedlHow-tos3 comments – viewed 55,094 times – ( +10 ) – 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

Configuring controller access rules to default-deny

Created 3 years ago by Steve FriedlHow-tos3 comments – viewed 54,739 times – ( +11 ) – version 1.1
Starting with the blog tutorial, Yii developers are familiar with the notion of access rules defined in the controller, where the actions are allowed or denied depending on the user's name or role.

How to setup RBAC with a php file

Created 4 years ago by bettorHow-tos17 comments – viewed 51,496 times – ( +26 / -4 ) – version 1.1
In this cookbook I will attempt to explain how to use the lightweight version of Role-Based Access Control using a php file. This version does not use database but a php file and is controlled by CPhpAuthManager class.

Implementing cron jobs with Yii

Created 3 years ago by samdarkHow-tos5 comments – viewed 49,145 times – ( +30 / -1 ) – version 1.1
There are two ways to run a cron job:
tags: cron, cli