Error width application-level parameters (Yii::app()->params)

Hello. When i try to get a value of my params defined in the config/main i get this Exception:

Object configuration must be an array containing a "class" element.

This is my action:

116     public function actionTest()

117     {

118         var_dump(Yii::app()->params['adminEmail']);

119     }

This is my main config:

        // application-level parameters that can be accessed

        // using Yii::app()->params['paramName']


            // this is used in contact page





The main.php config should be like

return array(


	'params' => array(

		'adminEmail' => '',



Check that your ‘params’ is not inside another array like ‘components’…

Obviously the problem is not with params configuration, but probably with some other part(s) of your config/main.php

Post here your complete config/main.php or check that params is key of root array (that is applications properties).

I do not know why but I was sure that params was in to components array… Thanks!

What you get with?

public function actionTest()