Answers.Body: <p>It sounds like you're attempting to access the <code>getDeveloper</code> method on your plugin's main <a href="https://craftcms.com/docs/plugins/services" rel="nofollow noreferrer">service class</a>, but the class doesn't exist.</p>
  
  <p>You have two options:</p>
  
  <ol>
  <li>Create the service class, and implement a <code>getDeveloper</code> method.</li>
  <li>Call the <code>getDeveloper</code> method on your main plugin class (which I suspect is what you're really trying to do).</li>
  </ol>
  
  <h2>Option One: Service</h2>
  
  <p>Your minimal service class will look like this:</p>
  
  <pre><code>&lt;?php
  
  namespace Craft;
  
  class CrmPortalService extends BaseApplicationComponent
  {
      /**
       * Returns the developer name.
       *
       * You could either hard-code the developer name, or you could
       * retrieve it from the main plugin class, as described in
       * option two.
       *
       * @return string
       */
      public function getDeveloper()
      {
          return 'John Doe';
      }
  }
  </code></pre>
  
  <h2>Option Two: Plugin</h2>
  
  <p>Craft uses Services to expose functionality, in exactly the same way that plugins do. If you're trying to figure out how to do something, just look for a Craft Service with a similar name.</p>
  
  <p>In this case, you want to retrieve your main plugin file, so <a href="https://craftcms.com/classreference/services/PluginsService" rel="nofollow noreferrer">the <code>PluginsService</code></a> is a good place to start. We're in luck, it has <a href="https://craftcms.com/classreference/services/PluginsService#getPlugin-detail" rel="nofollow noreferrer">a <code>getPlugin</code> method</a>, which accepts a plugin handle, and returns the plugin class.</p>
  
  <p>Here's how you might use that, to call the <code>getDeveloper</code> method in your main plugin class.</p>
  
  <pre><code>craft()-&gt;plugins-&gt;getPlugin('crmPortal')-&gt;getDeveloper();
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-26T00:53:00.830Z
Answers.Text: I want to access the getDeveloper() method in the CrmPortalPlugin.php and print it into the screen
Answers.UserDisplayName: lance adrianne dela cruz
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-26T00:59:45.967Z
Answers.Text: What I did was I create a function developerName() in Variable.php and  put the craft()->plugins->getPlugin('crmPortal')->getDeveloper();. And i used it in my template to print it on the screen using {{ craft.crmPortal.developerName() }}
Answers.UserDisplayName: lance adrianne dela cruz
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-26T01:01:50.570Z
Answers.Text: Good to hear you got it sorted. If you haven't already done so, I recommend having a read through [the plugin development documentation](https://craftcms.com/docs/plugins/introduction), to understand how the various elements of a plugin work together.
Answers.UserDisplayName: Stephen Lewis
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-26T01:09:59.697Z
Answers.Text: Thank you sir . Can you also give me an advice on what to read if i want to make an http request in craft cms?
Answers.UserDisplayName: lance adrianne dela cruz
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-26T01:14:38.320Z
Answers.Text: I take it you mean an HTTP request from your plugin to an external site (such as an API)? If so, you should take a look at [Guzzle](http://guzzle3.readthedocs.io/docs.html) (version 3 is a bit out of date, but it's what Craft uses internally, so it's easier to just stick with that).
Answers.UserDisplayName: Stephen Lewis
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-26T01:17:58.197Z
Answers.Text: Yes Sir. Thanks . This will be a great help to me
Answers.UserDisplayName: lance adrianne dela cruz
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-25T17:52:20.613Z
Answers.LastActivityDate: 2017-04-26T00:09:48.233Z
Answers.LastEditDate: 2017-04-26T00:09:48.233Z
Answers.UserDisplayName: Stephen Lewis
Body: <p>I want to get the developer name from Plugin.php using the getDeveloper() method so I created a function devName() in Variable.php</p>
  
  <pre><code>public function devName() {
      return craft()-&gt;crmPortal-&gt;getDeveloper();
  }
  </code></pre>
  
  <p>but when i want it to print it in my template, using this <code>{{craft.crmPortal.devName}}</code> I'm having this Error. Property "Craft\WebApp.crmPortal" is not defined.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-04-25T08:44:31.650Z
Comments.Text: Two things - you're using `devName` and `getName` ... and as I mentioned, it may be a case sensitivity issue - what's the actual class name of your plugin that you've defined?
  
  And you've installed your plugin in setting right?
Comments.UserDisplayName: Jeremy Daalder
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-04-25T08:55:25.677Z
Comments.Text: Yup ! i installed it in plugin settings. the class name in my CrmPortalPlugin.php is => class CrmPortalPlugin
Comments.UserDisplayName: lance adrianne dela cruz
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-04-25T08:58:34.813Z
Comments.Text: Craft\CrmPortalService and its behaviors do not have a method or closure named "getDeveloper". I'm getting this error right now
Comments.UserDisplayName: lance adrianne dela cruz
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-04-25T08:59:39.933Z
Comments.Text: Yes, because you have called the function devName() above...so use `.devName` in your twig code.  All this stuff is very name sensitive.
Comments.UserDisplayName: Jeremy Daalder
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-04-25T09:01:19.970Z
Comments.Text: do i need to right something in services ?
Comments.UserDisplayName: lance adrianne dela cruz
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-04-25T09:03:45.360Z
Comments.Text: You need to implement your function to return that data...which could be via a call to a service, or you could make the developer name a static class var...lots of ways really!
Comments.UserDisplayName: Jeremy Daalder
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-04-25T09:05:09.573Z
Comments.Text: How should i call it on a service . I'm sorry if ask many questions. i'm just a beginner in craft cms
Comments.UserDisplayName: lance adrianne dela cruz
Tags: <plugin-development>
Title: Plugin Variable.php Problem
ThreadText: # Plugin Variable.php Problem
  
  (Asked by: username_0 on 2017-04-25)
  
  I want to get the developer name from Plugin.php using the getDeveloper() method so I created a function devName() in Variable.php
  
  ```
  public function devName() {
      return craft()->crmPortal->getDeveloper();
  }
  
  ```
  
  but when i want it to print it in my template, using this `{{craft.crmPortal.devName}}` I'm having this Error. Property "Craft\WebApp.crmPortal" is not defined.
  
  **Tags:** plugin-development
  
  > **Comments:**
  > **username_1**: Two things - you're using `devName` and `getName` ... and as I mentioned, it may be a case sensitivity issue - what's the actual class name of your plugin that you've defined?  And you've installed your plugin in setting right?  
  > **username_0**: Yup ! i installed it in plugin settings. the class name in my CrmPortalPlugin.php is => class CrmPortalPlugin  
  > **username_0**: Craft\CrmPortalService and its behaviors do not have a method or closure named "getDeveloper". I'm getting this error right now  
  > **username_1**: Yes, because you have called the function devName() above...so use `.devName` in your twig code.  All this stuff is very name sensitive.  
  > **username_0**: do i need to right something in services ?  
  > **username_1**: You need to implement your function to return that data...which could be via a call to a service, or you could make the developer name a static class var...lots of ways really!  
  > **username_0**: How should i call it on a service . I'm sorry if ask many questions. i'm just a beginner in craft cms  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2017-04-25. Score: 3 | Accepted answer
  
  It sounds like you're attempting to access the `getDeveloper` method on your plugin's main [service class](https://craftcms.com/docs/plugins/services), but the class doesn't exist.
  
  You have two options:
  
  1. Create the service class, and implement a `getDeveloper` method.
  2. Call the `getDeveloper` method on your main plugin class (which I suspect is what you're really trying to do).
  
  ## Option One: Service
  
  Your minimal service class will look like this:
  
  ```
  <?php
  
  namespace Craft;
  
  class CrmPortalService extends BaseApplicationComponent
  {
      /**
       * Returns the developer name.
       *
       * You could either hard-code the developer name, or you could
       * retrieve it from the main plugin class, as described in
       * option two.
       *
       * @return string
       */
      public function getDeveloper()
      {
          return 'John Doe';
      }
  }
  
  ```
  
  ## Option Two: Plugin
  
  Craft uses Services to expose functionality, in exactly the same way that plugins do. If you're trying to figure out how to do something, just look for a Craft Service with a similar name.
  
  In this case, you want to retrieve your main plugin file, so [the `PluginsService`](https://craftcms.com/classreference/services/PluginsService) is a good place to start. We're in luck, it has [a `getPlugin` method](https://craftcms.com/classreference/services/PluginsService#getPlugin-detail), which accepts a plugin handle, and returns the plugin class.
  
  Here's how you might use that, to call the `getDeveloper` method in your main plugin class.
  
  ```
  craft()->plugins->getPlugin('crmPortal')->getDeveloper();
  
  ```
  
  > **Comments:**
  > **username_0**: I want to access the getDeveloper() method in the CrmPortalPlugin.php and print it into the screen  
  > **username_0**: What I did was I create a function developerName() in Variable.php and  put the craft()->plugins->getPlugin('crmPortal')->getDeveloper();. And i used it in my template to print it on the screen using {{ craft.crmPortal.developerName() }}  
  > **username_2**: Good to hear you got it sorted. If you haven't already done so, I recommend having a read through [the plugin development documentation](https://craftcms.com/docs/plugins/introduction), to understand how the various elements of a plugin work together.  
  > **username_0**: Thank you sir . Can you also give me an advice on what to read if i want to make an http request in craft cms?  
  > **username_2**: I take it you mean an HTTP request from your plugin to an external site (such as an API)? If so, you should take a look at [Guzzle](http://guzzle3.readthedocs.io/docs.html) (version 3 is a bit out of date, but it's what Craft uses internally, so it's easier to just stick with that).  
  > **username_0**: Yes Sir. Thanks . This will be a great help to me  
  
  ---
  
  