Call to a member function getApi() on a non-object
Closed this issue · 7 comments
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!
check how you configured the component, as getApi is a method on YiiWheels component, therefore the getComponent('yiiwheels')
is not working
Antonio, just to make sure - in Yiiwheels "Get started" section there is nothing about configuration of Yiiwheels component, only Yiistrap configuration is mentioned.
// yiiwheels configuration
'yiiwheels' => realpath(DIR . '/../extensions/yiiwheels'), // change if necessary
I understand that (see my first message) :)
Will you change http://yiiwheels.2amigos.us/site/started for others' understanding as well?
@xloading I'm sure antonio would accept a pull request against yiiwheels-docs to update the documentation site:
https://github.com/2amigos/yiiwheels-docs
@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!