How do I reference the settings of my plugin from a template? This question and answer explains how to access a plugin's settings from elsewhere in the plugin's PHP code.

How would I access these settings from within a template? Or this impossible and I'd have to pass the values into the template when rendering it? ie, in a Controller action:

$settings = craft()-&gt;plugins-&gt;getPlugin('myPlugin')-&gt;getSettings();
$templateVars = array(
    'foo' =&gt; $settings-&gt;foo,
);
$this-&gt;renderTemplate('myPlugin/templateName', $templateVars);
In more recent versions of Craft 2.x (I forget when it was added), you can simply do this without needing a plugin:

craft.config.get('setting', 'plugin')


Where 'plugin' is the name of your plugin's config file (sans .php).

If you want to do this in Craft 3, you'd do:

craft.app.getModule('pluginHandle').getSettings().mySetting