2

I'm writing a plugin, and used plugin.io to generate my scaffolding. In my controller I am attempting to call a service, and getting an error.

This is my service code from my generated plugin it lives at fulcrumdonation/services/FulcrumDonation_FulcrumCyberSourceService.php:

class FulcrumDonation_FulcrumCyberSourceService extends BaseApplicationComponent
{
    /**
     *
     * From any other plugin file, call it like this:
     *
     *     craft()->fulcrumDonation_FulcrumCyberSource->exampleService()
     */
    public function exampleService()
    {
    }
}

And just as the scaffolding suggests, I'm attempting to call this function in the controller:

craft()->fulcrumDonation_FulcrumCyberSource->exampleService();

But when I add that line of code in the controller I get the following error:

Property "Craft\WebApp.fulcrumDonation_FulcrumCyberSource" is not defined.

What am I missing here?

  • 2
    Looks like there's a mistake in my generator. Lo ciento, I will fix it – andrew.welch May 25 '16 at 0:27
  • Awesome, thanks! And also, thank you @khalwat for your generator. You saved me a lot of work and research when beginning my first plugin. – danieltalsky May 28 '16 at 2:29
4

Try it with a lowercase f in the middle...

craft()->fulcrumDonation_fulcrumCyberSource->exampleService();
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.