Hi,
I would like to know if it’s possible to capture in the controller the value of the configuration parameters defined for a widget. For example in the code below the class configuration
View
<?
$this->widget(‘ext.EAjaxUpload.EAjaxUpload’, array(
'id' => 'uploadFile',
'config' => array(
'action' => Yii::app()->baseUrl.'/upload/upload',
'allowedExtensions' => array("jpg"), //array("jpg","jpeg","gif","exe","mov" and etc...
'sizeLimit' => 10 * 1024 * 1024, // maximum file size in bytes
'minSizeLimit' => 1, // minimum file size in bytes
'class' => 'project',
)
));
?>
Controller
public function actionUpload() {
$folder = 'upload/project/'; // folder for uploaded files
%theValueofclass = <img src='http://www.yiiframework.com/forum/public/style_emoticons/default/huh.gif' class='bbc_emoticon' alt='???' />¿¿¿¿¿
Yii::import("ext.EAjaxUpload.qqFileUploader");
$allowedExtensions = array("jpg"); //array("jpg","jpeg","gif","exe","mov" and etc...
$sizeLimit = 10 * 1024 * 1024; // maximum file size in bytes
$uploader = new qqFileUploader($allowedExtensions, $sizeLimit);
$result = $uploader->handleUpload($folder);
$result = htmlspecialchars(json_encode($result), ENT_NOQUOTES);
echo $result; // it's array
}
}