Wiki

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

Actions code reuse with CAction

Created 2 years ago by Antonio RamirezHow-tos13 comments – viewed 18,103 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 8 months ago by François GannazHow-tos2 comments – viewed 36,010 times – ( +28 )
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,705 times – ( +27 )
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 45,512 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 16,192 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 24,144 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 2 years ago by zaccariaHow-tos3 comments – viewed 14,515 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 16,366 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,962 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,987 times – ( +21 )
Let's say we have two models and relation between them: