Answers.Body: <p>After my changes, this worked:</p>
  
  <pre><code>value="psychEmail/publication/pubRequest"
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-21T20:00:27.523Z
Answers.LastActivityDate: 2017-04-21T20:30:56.380Z
Answers.LastEditDate: 2017-04-21T20:30:56.380Z
Answers.UserDisplayName: Chip Shank
Body: <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>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-04-21T19:42:11.793Z
Comments.Text: After some reading I changed my controller to PsychEmail_PublicationController. php, but, I am still having issues with the path.
Comments.UserDisplayName: Chip Shank
Tags: <plugin-development>
Title: How to reference controller action from hidden action? Correct path?
ThreadText: # 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:
  
  ```
  <form method="post" action="" accept-charset="UTF-8">
      <input type="hidden" name="action" value="psychEmail/pubRequest">
  
      <!-- ...-->
  
      <input class="btn submit" type="submit" value="{{ 'Submit'|t }}">
  </form>
  
  ```
  
  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"
  
  ```
  
  
  ---
  
  