Answers.Body: <p>Little bit confused with your question, if you want to access your settings then you can do craft::$app->plugins->getPlugin('handle')->getSettings()->foo;</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-26T03:52:15.423Z
Answers.Text: That worked but is very different than the 3.0 docs that I reference.
Answers.UserDisplayName: Eric Snyder
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-26T05:00:23.780Z
Answers.Text: If you are calling that method from elsewhere page then you use namespace else you will be using the one that i provided.
Answers.UserDisplayName: sailendra mangranti
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-26T05:14:40.427Z
Answers.Text: Note: this solution is the slower, performance worse one, that calls the `ns\prefix\Plugin::getInstance()->getSettings()` in the end. I suggest to download a proper IDE that handles all namespaces and includes for you and aceess the plugin directly.
Answers.UserDisplayName: Robin Schambach
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-26T11:30:11.877Z
Answers.Text: I am using Netbeans. I am editing the plugin locally and running a LAMP server on my laptop. When I test my code I refresh the page in the browser from my local machine. The code ns\prefix\Plugin::getInstance()->getSettings()->ulStateClass; or recoveryfinder\craftnav::getInstance()->getSettings()->ulStateClass; was not working from my local machine server.
Answers.UserDisplayName: Eric Snyder
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-26T23:06:51.473Z
Answers.Text: @robin-schamback I said I was using Netbeans. I suppose I should have said I was abusing Netbeans :)! What do you recommend?
Answers.UserDisplayName: Eric Snyder
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-26T23:18:34.790Z
Answers.Text: PhpStrom maybe !!!
Answers.UserDisplayName: sailendra mangranti
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-26T02:38:19.367Z
Answers.LastActivityDate: 2018-03-26T02:38:19.367Z
Answers.UserDisplayName: sailendra mangranti
Answers.Body: <p>Try</p>
  
  <pre><code>\recoveryfinder\craftnav\Craftnav::getInstance()-&gt;getSettings()-&gt;ulStateClass;
  </code></pre>
  
  <p>Assuming your main plugin file/class is Craftnav.php</p>
  
  <p>Hope this helps :)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-10T23:11:38.340Z
Answers.LastActivityDate: 2019-01-10T23:11:38.340Z
Answers.UserDisplayName: Oli
Body: <p>My plugin structure was created by <a href="https://pluginfactory.io/" rel="nofollow noreferrer">the plugin factory</a>. I have a setting called ulStateClass and I have been able to change the value of that setting in the Setting for the plug in. Looking at the <a href="https://github.com/craftcms/docs/blob/v3/en/plugin-settings.md" rel="nofollow noreferrer">3.0 Docs page</a> for settings I see the example:</p>
  
  <pre><code>// From your main plugin class:
  $foo = $this-&gt;getSettings()-&gt;foo;
  
  // From elsewhere:
  $foo = \ns\prefix\Plugin::getInstance()-&gt;getSettings()-&gt;foo;
  </code></pre>
  
  <p>My namespace is recoveryfinder\craftnav</p>
  
  <p>In my services php file I have the following to test:</p>
  
  <pre><code>echo \recoveryfinder\craftnav::getInstance()-&gt;getSettings()-&gt;ulStateClass;
  </code></pre>
  
  <p>I am getting the error:</p>
  
  <blockquote>
    <p>Error Class 'recoveryfinder\craftnav' not found</p>
  </blockquote>
  
  <p>Making progress with Craft and enjoying it. I am guessing that this is a misuse or misunderstanding of namespaces? How Do I correct this?</p>
  
Tags: <plugin-development><craft3><settings>
Title: Trouble accessing setting
ThreadText: # Trouble accessing setting
  
  (Asked by: username_0 on 2018-03-26)
  
  My plugin structure was created by [the plugin factory](https://pluginfactory.io/). I have a setting called ulStateClass and I have been able to change the value of that setting in the Setting for the plug in. Looking at the [3.0 Docs page](https://github.com/craftcms/docs/blob/v3/en/plugin-settings.md) for settings I see the example:
  
  ```
  // From your main plugin class:
  $foo = $this->getSettings()->foo;
  
  // From elsewhere:
  $foo = \ns\prefix\Plugin::getInstance()->getSettings()->foo;
  
  ```
  
  My namespace is recoveryfinder\craftnav
  
  In my services php file I have the following to test:
  
  ```
  echo \recoveryfinder\craftnav::getInstance()->getSettings()->ulStateClass;
  
  ```
  
  I am getting the error:
  
  > Error Class 'recoveryfinder\craftnav' not found
  
  Making progress with Craft and enjoying it. I am guessing that this is a misuse or misunderstanding of namespaces? How Do I correct this?
  
  **Tags:** plugin-development, craft3, settings
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-03-26. Score: 2 | Accepted answer
  
  Little bit confused with your question, if you want to access your settings then you can do craft::$app->plugins->getPlugin('handle')->getSettings()->foo;
  
  > **Comments:**
  > **username_0**: That worked but is very different than the 3.0 docs that I reference.  
  > **username_1**: If you are calling that method from elsewhere page then you use namespace else you will be using the one that i provided.  
  > **username_2**: Note: this solution is the slower, performance worse one, that calls the `ns\prefix\Plugin::getInstance()->getSettings()` in the end. I suggest to download a proper IDE that handles all namespaces and includes for you and aceess the plugin directly.  
  > **username_0**: I am using Netbeans. I am editing the plugin locally and running a LAMP server on my laptop. When I test my code I refresh the page in the browser from my local machine. The code ns\prefix\Plugin::getInstance()->getSettings()->ulStateClass; or recoveryfinder\craftnav::getInstance()->getSettings()->ulStateClass; was not working from my local machine server.  
  > **username_0**: @username_2-schamback I said I was using Netbeans. I suppose I should have said I was abusing Netbeans :)! What do you recommend?  
  > **username_1**: PhpStrom maybe !!!  
  
  ---
  
  ### Answer by username_3 on 2019-01-10. Score: 1
  
  Try
  
  ```
  \recoveryfinder\craftnav\Craftnav::getInstance()->getSettings()->ulStateClass;
  
  ```
  
  Assuming your main plugin file/class is Craftnav.php
  
  Hope this helps :)
  
  
  ---
  
  