Answers.Body: <p>Try it with a lowercase <code>f</code> in the middle...</p>
  
  <pre><code>craft()-&gt;fulcrumDonation_fulcrumCyberSource-&gt;exampleService();
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-25T01:24:58.607Z
Answers.Text: Thank you so much!  The plugin comment generator had it wrong!
Answers.UserDisplayName: danieltalsky
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-17T20:02:42.363Z
Answers.Text: I've since fixed this on https://pluginfactory.io
Answers.UserDisplayName: andrew.welch
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-24T23:42:13.687Z
Answers.LastActivityDate: 2016-05-24T23:42:13.687Z
Answers.UserDisplayName: Lindsey D
Body: <p>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.</p>
  
  <p>This is my service code from my generated plugin it lives at <code>fulcrumdonation/services/FulcrumDonation_FulcrumCyberSourceService.php</code>:</p>
  
  <pre><code>class FulcrumDonation_FulcrumCyberSourceService extends BaseApplicationComponent
  {
      /**
       *
       * From any other plugin file, call it like this:
       *
       *     craft()-&gt;fulcrumDonation_FulcrumCyberSource-&gt;exampleService()
       */
      public function exampleService()
      {
      }
  }
  </code></pre>
  
  <p>And just as the scaffolding suggests, I'm attempting to call this function in the controller:</p>
  
  <pre><code>craft()-&gt;fulcrumDonation_FulcrumCyberSource-&gt;exampleService();
  </code></pre>
  
  <p>But when I add that line of code in the controller I get the following error:</p>
  
  <blockquote>
    <p>Property "Craft\WebApp.fulcrumDonation_FulcrumCyberSource" is not
    defined.</p>
  </blockquote>
  
  <p>What am I missing here?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-05-25T00:27:41.187Z
Comments.Text: Looks like there's a mistake in my generator. Lo ciento, I will fix it
Comments.UserDisplayName: andrew.welch
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-05-28T02:29:38.037Z
Comments.Text: Awesome, thanks!  And also, thank you @khalwat for your generator.  You saved me a lot of work and research when beginning my first plugin.
Comments.UserDisplayName: danieltalsky
Tags: <plugin-development><controller><services>
Title: How do I call a service from my controller in a plugin?
ThreadText: # How do I call a service from my controller in a plugin?
  
  (Asked by: username_0 on 2016-05-24)
  
  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?
  
  **Tags:** plugin-development, controller, services
  
  > **Comments:**
  > **username_1**: Looks like there's a mistake in my generator. Lo ciento, I will fix it  
  > **username_0**: Awesome, thanks!  And also, thank you @khalwat for your generator.  You saved me a lot of work and research when beginning my first plugin.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2016-05-24. Score: 4 | Accepted answer
  
  Try it with a lowercase `f` in the middle...
  
  ```
  craft()->fulcrumDonation_fulcrumCyberSource->exampleService();
  
  ```
  
  > **Comments:**
  > **username_0**: Thank you so much!  The plugin comment generator had it wrong!  
  > **username_1**: I've since fixed this on https://pluginfactory.io  
  
  ---
  
  