Widget Installation In Yii

Widget : http://www.yiiframework.com/extension/wsocialbutton

I placed the file in application/extensions folder and placed the widget code in view index file but it is throwing error -

Alias "application.extensions.WSocialButton" is invalid. Make sure it points to an existing PHP file and the file is readable.

File permission 755

Solved this problem by creating a new folder "extensions" under the application folder and placing the file "WSocialButton.php" into it.

Added this code in my config/main.php file -






Did you put the file into a subfolder? Could it be an issue with uppercase/lowercase in the filename?

Following are the steps to include one widget in yii application

  1. Extract the zip file and copy the folder inside protected/extensions/

  2. In view file… you have to just include this line…[font=Menlo, Consolas,]<?php[/font][color=#808080][font=Menlo, Consolas,] [/font][/color][font=Menlo, Consolas,]$this[/font][color=#808080][font=Menlo, Consolas,]->[/font][/color][font=Menlo, Consolas,]widget[/font][font=Menlo, Consolas,]([/font][font=Menlo, Consolas,]’[/font][font=Menlo, Consolas,]application.extensions.WSocialButton[/font][font=Menlo, Consolas,]’[/font][color=#808080][font=Menlo, Consolas,], [/font][/color][font=Menlo, Consolas,]array[/font][font=Menlo, Consolas,]([/font][font=Menlo, Consolas,]’[/font][font=Menlo, Consolas,]style[/font][font=Menlo, Consolas,]’[/font][color=#808080][font=Menlo, Consolas,]=>[/font][/color][font=Menlo, Consolas,]’[/font][font=Menlo, Consolas,]box[/font][font=Menlo, Consolas,]’[/font][font=Menlo, Consolas,])[/font][font=Menlo, Consolas,])[/font][color=#808080][font=Menlo, Consolas,];[/font][/color][font=Menlo, Consolas,]?>…[/font][size=2]it should work [/size]

Actually I was placing the file in the extensions folder which is outside the protected directory.

To resolve this I placed the extension in protected/extensions directory.

code in the view file is -

<?php $this->widget('application.extensions.WSocialButton', array('style'=>'box'));?>

I think there was some path issue