Wiki

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

Actions code reuse with CAction

Created 2 years ago by Antonio RamirezHow-tos13 comments – viewed 17,261 times – ( +30 )
We all know how good 'gii' automates the code for us and we normally tend to be happy with what that tool offers at the beginning of our Yii learning curve. But as soon as you start working in larger and larger projects, you realize that its code is too repetitive to maintain and having a small pitfall in general actions means to go over and over through them to fix the issues.
tags: CAction, Tutorial

Javascript and AJAX with Yii

Created 7 months ago by François GannazHow-tos2 comments – viewed 31,583 times – ( +27 )
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

Enforcing "You must agree" requirements in forms

Created 2 years ago by Steve FriedlHow-tos2 comments – viewed 9,154 times – ( +26 )
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

Cookie management in Yii

Created 2 years ago by TrejderHow-tos4 comments – viewed 42,712 times – ( +39 / -1 )
Cookie management in Yii is easy, but may not be so obvious for the beginners to this framework, so I wrote this simple article to clear some doubts out.

Authenticating against phpass hashes with Yii

Created about a year ago by Da:SourcererHow-tos18 comments – viewed 15,698 times – ( +25 )
The Portable PHP password hashing framework allows advanced password hashing offering increased security over simple MD5- or SHA1-hashed passwords. phpass is already in use in some larger projects such as WordPress (since v2.5), Drupal 7 and phpBB 3.

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

Created 2 years ago by Maurizio DombaHow-tos5 comments – viewed 22,929 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.

How to use an application behavior to maintain runtime configuration

Created about a year ago by zaccariaHow-tos3 comments – viewed 13,765 times – ( +24 )
In this tutorial will be explained a method to manage some configuration runtime. This excellent tutorial follows a similar approach, but requires to write a masterclass which all controllers are supposed to extend, following this wiki you can achieve the same by only editing the configuration.

Single sign on across multiple subdomains

Created 2 years ago by ianaréHow-tos6 comments – viewed 15,551 times – ( +22 )
This had me stumped for a while so I figured it would be nice to share here to avoid others the grief.

How to use a Widget as an Action Provider

Created 2 years ago by Antonio RamirezHow-tos8 comments – viewed 18,204 times – ( +22 )
As written on the API docs: An Action Provider Widget is a widget that has declared several actions by using its 'public static function actions()'. After, a Controller can easily import all its declared actions on its 'public function actions()'.
tags: Widgets, CAction

Searching and Sorting by Count of Related Items in CGridView

Created about a year ago by softarkHow-tos10 comments – viewed 16,081 times – ( +21 )
Let's say we have two models and relation between them: