Configuring Components

I get an error when configuring the components of the config files, and tried to call it in view.

This code is contained in the config files (main.php) :




'components'=>array(


		'shopingCart'=>array(

			'class'=>'ext.shoppingCart.EShoppingCart',

		),



and this code in view :




<?php $this->Widget('shopingCart',array()); ?>



then when I run it appears an error like this:




YiiBase::include(shopingCart.php) [<a href='yiibase.include'>yiibase.include</a>]: failed to open stream: No such file or directory 



What should I fix the code that I created.

or if there is a link for this example, I am very happy.

thank you

Widgets can’t be configured in main.php because they aren’t application components. Use widgetFactory component and skins when a widget needs application-wide configuration.

You have to import the widget with Yii::import(), or use the full path alias when instantiating it.

Hello.

if a lot of logic is needed to present a partial view, the partial view can

be turned into a widget whose class file is the best place to contain this logic. For

widgets that generate a lot of HTML markup, it is best to use view file specific to

the widget to contain the markup.