<p>After my changes, this worked:</p>

<pre><code>value="psychEmail/publication/pubRequest"
</code></pre>

CC BY-SA 3.0
2017-04-21T20:00:27.523Z
2017-04-21T20:30:56.380Z
2017-04-21T20:30:56.380Z
Chip Shank
<p>I have seen a number of different paths, but, it is a bit confusing to me. What should be in my value in the HIDDEN input action below?</p>

<p>I have a twig page at my root:</p>

<pre><code>&lt;form method="post" action="" accept-charset="UTF-8"&gt;
    &lt;input type="hidden" name="action" value="psychEmail/pubRequest"&gt;

    &lt;!-- ...--&gt;

    &lt;input class="btn submit" type="submit" value="{{ 'Submit'|t }}"&gt;
&lt;/form&gt;
</code></pre>

<p>and then I have a plugin <code>PsychEmailPlugin.php</code> class file with 
<code>class PsychEmailPlugin extends BasePlugin</code></p>

<p>and then I have a controllers subdirectory with a <code>PsychEmailController.php</code> file that contains an action:</p>

<pre><code>class PsychEmailController extends BaseController
{
    public function actionPubRequest($emailAddress)
    {
        $email = new EmailModel();
        $email-&gt;fromEmail = $emailAddress;
        $email-&gt;toEmail = 'myemail@gmail.com';
        $email-&gt;subject = 'Publication Request';
        $email-&gt;body    = 'Your requested publication is attached.';

        craft()-&gt;email-&gt;sendEmail($email);
    }
}
</code></pre>

CC BY-SA 3.0
2017-04-21T19:42:11.793Z
After some reading I changed my controller to PsychEmail_PublicationController. php, but, I am still having issues with the path.
Chip Shank
<plugin-development>
How to reference controller action from hidden action? Correct path?
# How to reference controller action from hidden action? Correct path?

(Asked by: username_0 on 2017-04-21)

I have seen a number of different paths, but, it is a bit confusing to me. What should be in my value in the HIDDEN input action below?
I have a twig page at my root:

    

    

    


and then I have a plugin PsychEmailPlugin.php class file with 
class PsychEmailPlugin extends BasePlugin
and then I have a controllers subdirectory with a PsychEmailController.php file that contains an action:
class PsychEmailController extends BaseController
{
    public function actionPubRequest($emailAddress)
    {
        $email = new EmailModel();
        $email->fromEmail = $emailAddress;
        $email->toEmail = 'myemail@gmail.com';
        $email->subject = 'Publication Request';
        $email->body    = 'Your requested publication is attached.';

        craft()->email->sendEmail($email);
    }
}

**Tags:** plugin-development

> **Comments:**
> **username_0**: After some reading I changed my controller to PsychEmail_PublicationController. php, but, I am still having issues with the path.  

---

## 1 answers

### Answer by username_0 on 2017-04-21. Score: 1 | Accepted answer

After my changes, this worked:
value="psychEmail/publication/pubRequest"


---

