CActiveform Problem

Hi,

if(isset($_POST[‘Song’],$_POST[‘Album’],$_POST[‘Artist’]))

{

$model->attributes=$_POST[‘Song’];

$album->attributes=$_POST[‘Album’];

$artist->attributes=$_POST[‘Artist’];

$valid= $model->validate();

$valid = $artist->validate() && $valid;

$valid = $album->validate() && $valid;

i have something like this and the thing is for artist there are other attributes and i don’t want them to be required in this form but i want them in other forms so what can i do?

define scenarios (http://www.yiiframework.com/doc/api/1.1/CModel#scenario-detail) and in each Model’s validation section define the validation for the respective scenario such as


array('email', 'email', 'on' => 'update'),

This will validate email attribute on update scenario only and will skip for the others