2amigos / yiiwheels

Widget extension library for the YiiStrap extension
http://yiiwheels.2amigos.us
Other
133 stars 77 forks source link

Call to a member function getApi() on a non-object #31

Closed xloading closed 11 years ago

xloading commented 11 years ago

Hi Antonio!

I've installed Yiistrap+Yiiwheels in my Yii project and tried to use Redactor widget in my admin module, but unfortunately got the following: Fatal error: Call to a member function getApi() on a non-object in Z:\home...\www\protected\extensions\yiiwheels\behaviors\WhPlugin.php on line 43

Can it be caused by the fact that I'm trying to use it from module? Or because I don't use Composer in my project yet?

Eventually I got it working after adding the following to my config's components section:

'yiiwheels'=>array(
            'class' => 'yiiwheels.YiiWheels',
        ),

Is that correct or am I doing something wrong?

Thanks for the great work you're doing!

tonydspaniard commented 11 years ago

check how you configured the component, as getApi is a method on YiiWheels component, therefore the getComponent('yiiwheels') is not working

xloading commented 11 years ago

Antonio, just to make sure - in Yiiwheels "Get started" section there is nothing about configuration of Yiiwheels component, only Yiistrap configuration is mentioned.

tonydspaniard commented 11 years ago

// yiiwheels configuration 'yiiwheels' => realpath(DIR . '/../extensions/yiiwheels'), // change if necessary

xloading commented 11 years ago

I understand that (see my first message) :) Will you change http://yiiwheels.2amigos.us/site/started for others' understanding as well?

PrplHaz4 commented 11 years ago

@xloading I'm sure antonio would accept a pull request against yiiwheels-docs to update the documentation site: https://github.com/2amigos/yiiwheels-docs

xloading commented 11 years ago

@PrplHaz4 unfortunately I'm not enough experienced yet with forking and pull requests using Git, so it may take some time for me to help with this. Will try to do that this evening though... Thanks!

tonydspaniard commented 11 years ago

done https://github.com/2amigos/yiiwheels-docs/commit/b8a7e8c326aa9ccd1b6021a69b5e587e68397594