<p>In addition to Ben Parizek answer, here is a full example code to get value of a "foo" setting from a "bar" plugin, using magic get methods.</p>

<pre><code>$pluginSettings = craft()-&gt;plugins-&gt;getPlugin('bar')-&gt;getSettings();
$foo = $pluginSettings-&gt;foo;
</code></pre>

CC BY-SA 3.0
2014-06-29T19:53:16.367Z
Where the magic exists, it's worth using... Thanks!
Lindsey D
CC BY-SA 3.0
2014-06-29T14:10:59.063Z
2014-06-29T19:55:56.543Z
2014-06-29T19:55:56.543Z
yann_yinn
<p>Try:</p>

<pre><code>craft()-&gt;plugins-&gt;getPlugin('myPlugin')-&gt;getSettings()
</code></pre>

CC BY-SA 3.0
2014-06-24T02:36:08.633Z
2014-06-24T03:39:01.623Z
2014-06-24T03:39:01.623Z
Ben Parizek
<p>In the main <code>Plugin.php</code> file of my plugin, I can retrieve the plugin's settings like this:</p>

<pre><code>$this-&gt;getSettings()
</code></pre>

<p><strong>How do I retrieve those same settings from elsewhere in the plugin?</strong></p>

<p>I want to reference those setting from my <code>Service.php</code> file.</p>

<plugin-development>
How do I reference the settings of my plugin?
# How do I reference the settings of my plugin?

(Asked by: username_0 on 2014-06-24)

In the main Plugin.php file of my plugin, I can retrieve the plugin's settings like this:
$this->getSettings()

How do I retrieve those same settings from elsewhere in the plugin?
I want to reference those setting from my Service.php file.

**Tags:** plugin-development

---

## 2 answers

### Answer by username_2 on 2014-06-24. Score: 15 | Accepted answer

Try:
craft()->plugins->getPlugin('myPlugin')->getSettings()


---

### Answer by username_1 on 2014-06-29. Score: 10

In addition to Ben Parizek answer, here is a full example code to get value of a "foo" setting from a "bar" plugin, using magic get methods.
$pluginSettings = craft()->plugins->getPlugin('bar')->getSettings();
$foo = $pluginSettings->foo;

> **Comments:**
> **username_0**: Where the magic exists, it's worth using... Thanks!  

---

