<?php

$class_1 = array_get($_REQUEST, 'class_1');
$class_2 = array_get($_REQUEST, 'class_2');
$class_b = array_get($_REQUEST, 'class_bridge');
$relation = array_get($_REQUEST, 'relation');
$name = array_get($_REQUEST, 'name');
$conditions = array_get($_REQUEST, 'conditions');

if(isEmpty($class_1) || isEmpty($class_2) || isEmpty($class_b) || isEmpty($relation) || isEmpty($name))
{
  user()->setFlash('error', 'Fill all the fields');
  $this->redirectTo('debug/model_createRelation');
  exit;
}

$class_1_attributes = $class_1::model()->attributeNames();
$class_2_attributes = $class_2::model()->attributeNames();
$class_b_attributes = $class_b::model()->attributeNames();
?>

<form method="post">
<?php 
echo CHtml::hiddenField('name', $name);
echo CHtml::hiddenField('conditions', $conditions);
echo CHtml::hiddenField('relation', $relation);
echo CHtml::hiddenField('class_1', $class_1);
echo CHtml::hiddenField('class_2', $class_2);
echo CHtml::hiddenField('class_b', $class_b);

echo CHtml::dropDownList('', $select, $data)

?>
<input type="submit" />
</form>