Facing enctype problem in CActiveForm

Please I need help…

How can i set enctype=‘multipart/form-data’ in below CActiveForm? I want to upload some files.




<?php $form=$this->beginWidget('CActiveForm', array(

	'id'=>'projects-form',

	'enableAjaxValidation'=>false,

)); ?>



I tried to use




<?php echo CHtml::form('','post',array('enctype'=>'multipart/form-data')); ?>



But as my rules are coming from model and other stuff so it did not work for me… Also i am using CMultiFileUpload for uploading multiple files…

Any idea ???

Nobody… :(

Get solution. We have to add htmloptions in CActiveform for this purpose

Like this.




<?php $form=$this->beginWidget('CActiveForm',  array(

	'id'=>'projects-form',

	'enableAjaxValidation'=>false,

        'htmlOptions' => array(

            'enctype' => 'multipart/form-data'

        )

)); ?>



:)

here’s more complete explanation about uploading file with CActiveForm

http://www.yiiframework.com/wiki/2/