This is an awesome extension, Thank you!
I have a question regarding visible items in the steps (after scouring the net and reading all the threads)… so here goes…
I need to add the current users ID (Yii::app()->user->id) to the final output. I can do this, but then the value is shown. The minute I try “hide” or set it’s visible property to false, it’s not included in the array.
Here’s a snippet of the model code in step 1:
class Wizard_step1 extends CFormModel {
public $user_id;
public $turnover;
public function rules() {
return array
(
array('user_id, turnover', 'safe'),
);
}
public function getForm() {
$te = Yii::app()->user->id;
return new CForm(array(
'showErrorSummary'=>true,
'elements'=>array(
'user_id'=>array
(
'type'=>'text',
'value'=>$te,
),
'turnover'=>array
(
'type'=>'dropdownlist',
'items'=>array
(,
''=>'', //this forces validation to check for a value, i.e. value in dropdown box not selected... won't continue to next step (for those that want this functionality <img src='http://www.yiiframework.com/forum/public/style_emoticons/default/smile.gif' class='bbc_emoticon' alt=':)' />
'2'=>'R0m - R1.5m',
'3'=>'R1.5m - R2.5m',
'4'=>'R2.5m - R5m',
'5'=>'R5m - R11.5m',
'6'=>'R11.5m - R15m',
)
),
what can I do in order to set this so that the user_id is not visible to the user, but will still be added to array data at completion of all the steps? Maybe I’m doing it completely wrong and the data needs to be added elsewhere in the program? any assistance will be great!
Regards,
G