Issue with rendering a template from a plugin function I have an issue with rendering a template from within my controller in my plugin. It just seems to re-direct to the dashboard instead of bringing up the template.

I have a widget on the dashboard that calls an action in my plugin's controller file. This works as I can print_r the object I am creating. However when it gets to the render code it just keeps re-directing back to the dashboard. I've even tried stripping out all the code apart from the render call and it still does it. The code making the call is:

return craft()-&gt;templates-&gt;render('pluginName/index.html');


Which is currently the only code in the plugin function. The plugin has a templates folder where the index.html is held. I've also stripped the template down so it only contains the following:

{% extends "_layouts/cp" %}
{% set centered = true %}
{% set title = "The Title"|t %}

{% set content %}

&lt;p&gt;List the users&lt;/p&gt;

{% endset %}


Any clues anyone.
I haven't tried calling a template from a controller, so I may not be any help but I've used

...-&gt;render(...)


in my main plugin Class like this:

MyPlugin.php

return craft()-&gt;templates-&gt;render('myplugin/_settings', array('settings' =&gt; $this-&gt;getSettings()));


Maybe the render method is looking for another argument?

EDIT

Oh wait... I was wrong, it looks like I do...

MyPluginController.php

$vars['users'] = craft()-&gt;user-&gt;listUsers();
$this-&gt;renderTemplate('myplugin/index', $vars);


Then I have a variables file:

MyPluginVariable.php

public function getContacts()
{
    return craft()-&gt;contactForm-&gt;getUsers();
}


Which ties back to the my service:

MyPluginService.php

public function getUsers()
{
    return MyPluginRecord::model()-&gt;findAll(array('order' =&gt; 'dateCreated desc'));
}


Maybe that will help get you rolling?