S C R I P T B A K E R

Loading

Get selected value of radioButtonList using jQuery in Yii

Sometimes you want to get selected value of radioButtonList using jQuery in your Yii powered application and it feels difficult due to Yii’s field naming conventions, as every field name contains array.

Read More

Keeping your Yii Models Lean – Use Behaviors

Active Record models are fantastic for consolidating “black box” logic and keeping your models self-aware of their business logic, but what do you do when the business rules and object specific operations keep adding up?

Read More

Ajax based Yii login form

Ajax helps us creating fancy forms, Ajax based forms boost user experience. Yii framework provides ajax validation but at the end form is submitted without ajax and our page goes refreshed.

Read More

How to save multiple related models in Yii [Complete Solution]

Scenario: You are in a situation where you have two related tables a Parent and a child table. You need to create a user experience in which user presses Save button only once, meaning by, user enters all the data in parent model fields, then enters data in all child model fields, optionally generates more … Continue reading “How to save multiple related models in Yii [Complete Solution]”

Read More

Table ‘DATEBASE_NAME.AuthAssignment’ doesn’t exist

If you have used Rights module for RBAC in your Yii application and you deploy it on Linux based server, you may encounter this error.

Read More

How to make Yii checkBoxList selected

Many people find it hard to make the Yii checkBoxList selected on update view, but believe me in fact its very easy and straight forward. This post will help you in showing user’s last selection by showing them a preselected checkbox list.

Read More

How to separate front and admin panel in yii-framework

In my previous post I demonstrated you how to render different layout for different user role, now lets move a step forward and see how to create separate front and admin panel in a Yii based application.

Read More

Yii 1.1: Behaviors & Events

Behaviors & Events provide endless possibilities and unbelievable flexibility, but as current Yii documentation does not give more than a few examples, it might be difficult to fully understand their internals and requirements. It should be noted that they do mostly the same thing. You can attach behaviors and event handlers to components to modify … Continue reading “Yii 1.1: Behaviors & Events”

Read More

Yii password, repeat password fields

Yii framework has awesome input validation mechanism, one of the many validation rules is “compare” rule. You can utilize it for creating confirmation fields to verify user input. Its a good practice to get password input twice while creating signup and change password forms.

Read More

Disabled Yii logs and stack trace messages

Open up the index.php from root folder and comment out following 2 lines

Read More

Allow admin to change user role

1. Add following code to _form.php 2. Update actionCreate & actionUpdate of UsersController.php like this

Read More