Wiki

Displaying 531-540 of 691 result(s).

Actions code reuse with CAction

Created 3 years ago by Antonio RamirezHow-tos13 comments – viewed 29,595 times – ( +36 ) – version 1.1
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

Configuring controller access rules to default-deny

Created 3 years ago by Steve FriedlHow-tos3 comments – viewed 57,228 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.

Create your own Validation Rule

Created 3 years ago by nickcvHow-tos11 comments – viewed 122,416 times – ( +72 / -3 ) – version 1.1
Some times the core validation rules provided by Yii won't satisfy all your needs, so you'll need to create your very own validation rule.

Understanding Virtual Attributes and get/set methods

Created 3 years ago by Steve FriedlTutorials19 comments – viewed 89,305 times – ( +77 ) – version 1.1
When you define or extend a class, you can create class variables and methods in Yii just like you can in any other PHP system:

caching controllers with filters()

Created 3 years ago by RusAlexHow-tos1 comment – viewed 9,665 times – ( +2 ) – version 1.1
Hello, this article will describe some aspects about caching controllers with filters() method in your controller. And I will describe some problems I meet when using this approach for caching, the main problem was

Understanding Autoloading, Helper Classes and Helper Functions

Created 3 years ago by Steve FriedlTutorials4 comments – viewed 66,435 times – ( +29 ) – version 1.1
Many Yii users ask how to create helper classes and functions, and though there are numerous approaches spread out among the forum and wiki articles, this Tutorial tries to bring it all together in one place.

Updating fields on a form with Ajax and Json

Created 3 years ago by Russell EnglandHow-tos4 comments – viewed 45,037 times – ( +12 / -1 ) – version 1.1
I'm developing a website that has an option to look up a car's registration number via SOAP and return additional details such as make, model, colour etc.

Avoiding rendering entire page when using CGridView and CListView via AJAX

Created 3 years ago by xrxHow-tos17 comments – viewed 32,514 times – ( +23 ) – version 1.1
Since I used CGridView for a first time, I didn't like how it handled operations like sorting, filtering, changing page and etc using AJAX.

A simple action for CJuiAutoComplete

Created 3 years ago by tydeas_drTips9 comments – viewed 28,335 times – ( +16 / -1 ) – version 1.1
More or less I use auto-complete field for a form. CJuiAutoComplete is a yii widget for this purposes. The common use case is to make an ajax request and retrieve a list from the database. So in this case you have to write a controller action to return you a json encoded list. What if I had a generic action to do this work for me?

Understanding "Safe" Validation Rules

Created 3 years ago by Steve FriedlFAQs10 comments – viewed 72,352 times – ( +90 / -1 ) – version 1.1
A common source of confusion among new Yii users is how the 'safe' validator works, how it works with other validators, and why it's necessary in the first place. This article means to clear up this confusion, as well as explain the notion of Massive Assignment.