How to retrieve config parameters from widget in controller

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' =&gt; 'uploadFile',


'config' =&gt; array(


    'action' =&gt; Yii::app()-&gt;baseUrl.'/upload/upload',


    'allowedExtensions' =&gt; array(&quot;jpg&quot;), //array(&quot;jpg&quot;,&quot;jpeg&quot;,&quot;gif&quot;,&quot;exe&quot;,&quot;mov&quot; and etc...


    'sizeLimit' =&gt; 10 * 1024 * 1024, // maximum file size in bytes


    'minSizeLimit' =&gt; 1, // minimum file size in bytes


    'class' =&gt; 'project',


)

));

?>

Controller

public function actionUpload() {





    &#036;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(&quot;ext.EAjaxUpload.qqFileUploader&quot;);





    &#036;allowedExtensions = array(&quot;jpg&quot;); //array(&quot;jpg&quot;,&quot;jpeg&quot;,&quot;gif&quot;,&quot;exe&quot;,&quot;mov&quot; and etc...


    &#036;sizeLimit = 10 * 1024 * 1024; // maximum file size in bytes


    &#036;uploader = new qqFileUploader(&#036;allowedExtensions, &#036;sizeLimit);


    &#036;result = &#036;uploader-&gt;handleUpload(&#036;folder);


    &#036;result = htmlspecialchars(json_encode(&#036;result), ENT_NOQUOTES);


    echo &#036;result; // it's array


}

}

the way that you are going to handle configuration values is not a best practice.Define them in the main configuration file(protected/config/main.php) and access them.

[b]ex:

config/main.php[/b]

‘params’=>array(

‘size_limit’=>(10 * 1024 * 1024),

)

View

‘sizeLimit’ => Yii::app()->params[‘size_limit’];

[b]

Controller[/b]

$sizeLimit = Yii::app()->params[‘size_limit’];