Answers.Body: <p>Data in plugins is not automatically made available to twig templates.</p>
  
  <p>To make something available, you need to create a folder in your plugin master folder called <code>variables</code> and in that folder create a class <code>PluginNameVariable.php</code></p>
  
  <p>Here's an example of what you might put in that file:</p>
  
  <pre><code>&lt;?php
  
  namespace Craft;
  
  class YourPluginNameVariable
  {
  
      public function developerName()
      {
          return craft()-&gt;yourPluginsName-&gt;someServiceMethodThatReturnsTheDeveloperName();
      }
  
  }
  </code></pre>
  
  <p>This would make a template variable available in your templates via</p>
  
  <pre><code>{{ craft.yourPluginName.developerName }}
  </code></pre>
  
  <p>Here are the Craft Docs for this - <a href="https://craftcms.com/docs/plugins/variables" rel="nofollow noreferrer">https://craftcms.com/docs/plugins/variables</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-25T05:19:02.413Z
Answers.Text: Hi thanks for your response, I just followed what you've said but now, I'm getting an error  "Property "Craft\WebApp.crmportal" is not defined."
Answers.UserDisplayName: lance adrianne dela cruz
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-25T05:19:18.063Z
Answers.Text: *crmportal is maybe my handle name for the plugin
Answers.UserDisplayName: lance adrianne dela cruz
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-25T05:21:24.777Z
Answers.Text: Probable a case sensitivity issue.  Your best bet is to generate your plugin infrastructure using https://pluginfactory.io/ - this will give you all the structure correctly done & named, you just fill in the methods basically (choose variable in that!).  From there it's up to your PHP skills (start another question if you have different issues)
Answers.UserDisplayName: Jeremy Daalder
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-25T05:24:05.400Z
Answers.Text: ok sir . i'll try that
Answers.UserDisplayName: lance adrianne dela cruz
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-25T07:25:47.033Z
Answers.Text: I try using pluginfactory.io but nothing happens. it stays the same. having an error = " Property "Craft\WebApp.crmportal" is not defined. "
Answers.UserDisplayName: lance adrianne dela cruz
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-25T07:27:41.370Z
Answers.Text: Add the twig causing the error
Answers.UserDisplayName: Jeremy Daalder
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-25T05:10:32.287Z
Answers.LastActivityDate: 2017-04-25T05:10:32.287Z
Answers.UserDisplayName: Jeremy Daalder
Body: <p>I'm constructing a plug-in and I'm new to it. </p>
  
  <p>I want to print to the screen in my template the name of the developer, by accessing the <code>getDeveloper()</code> method in my <code>Plugin.php</code>. The problem is instead of showing the name of the developer, it throws an error saying <code>Class Craft\CrmPortalVariable</code> not found.</p>
  
Tags: <plugin-development>
Title: How to make plugin developer name available in templates?
ThreadText: # How to make plugin developer name available in templates?
  
  (Asked by: username_0 on 2017-04-25)
  
  I'm constructing a plug-in and I'm new to it.
  
  I want to print to the screen in my template the name of the developer, by accessing the `getDeveloper()` method in my `Plugin.php`. The problem is instead of showing the name of the developer, it throws an error saying `Class Craft\CrmPortalVariable` not found.
  
  **Tags:** plugin-development
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-04-25. Score: 4 | Accepted answer
  
  Data in plugins is not automatically made available to twig templates.
  
  To make something available, you need to create a folder in your plugin master folder called `variables` and in that folder create a class `PluginNameVariable.php`
  
  Here's an example of what you might put in that file:
  
  ```
  <?php
  
  namespace Craft;
  
  class YourPluginNameVariable
  {
  
      public function developerName()
      {
          return craft()->yourPluginsName->someServiceMethodThatReturnsTheDeveloperName();
      }
  
  }
  
  ```
  
  This would make a template variable available in your templates via
  
  ```
  {{ craft.yourPluginName.developerName }}
  
  ```
  
  Here are the Craft Docs for this - <https://craftcms.com/docs/plugins/variables>
  
  > **Comments:**
  > **username_0**: Hi thanks for your response, I just followed what you've said but now, I'm getting an error  "Property "Craft\WebApp.crmportal" is not defined."  
  > **username_0**: *crmportal is maybe my handle name for the plugin  
  > **username_1**: Probable a case sensitivity issue.  Your best bet is to generate your plugin infrastructure using https://pluginfactory.io/ - this will give you all the structure correctly done & named, you just fill in the methods basically (choose variable in that!).  From there it's up to your PHP skills (start another question if you have different issues)  
  > **username_0**: ok sir . i'll try that  
  > **username_0**: I try using pluginfactory.io but nothing happens. it stays the same. having an error = " Property "Craft\WebApp.crmportal" is not defined. "  
  > **username_1**: Add the twig causing the error  
  
  ---
  
  