title: Zend Framework: How to render a different action?
body: <p>I have two actions that are essentially identical, but need different URLs. Normally I would use <code>_forward()</code> to render the other action:</p>
  
  <pre><code>class MyController extends Zend_Controller_Action
  {
      public function actionOneAction()
      {
          $this-&gt;_forward('action-two');
      }
  
      public function actionTwoAction()
      {
          $this-&gt;view-&gt;foobar = 'foobar';
      }
  }
  </code></pre>
  
  <p>However, I have some code the is happening in <code>preDispatch()</code> that I only want to execute once:</p>
  
  <pre><code>class MyController extends Zend_Controller_Action
  {
      public function preDispatch()
      {
          //execute this only once before actionOne or actionTwo, but not both
      }
  
      public function actionOneAction()
      {
          $this-&gt;_forward('action-two'); //this won't work because preDispatch() will get called a second time
      }
  
      public function actionTwoAction()
      {
          $this-&gt;view-&gt;foobar = 'foobar';
      }
  }
  </code></pre>
  
  <p>So I thought maybe I could simply call the function directly, like this:</p>
  
  <pre><code>class MyController extends Zend_Controller_Action
  {
      public function preDispatch()
      {
          //execute this only once before actionOne or actionTwo, but not both
      }
  
      public function actionOneAction()
      {
          $this-&gt;actionTwoAction(); //execute the same code as actionTwoAction()
      }
  
      public function actionTwoAction()
      {
          $this-&gt;view-&gt;foobar = 'foobar';
      }
  }
  </code></pre>
  
  <p>But now Zend Framework is complaining about not being able to find the <code>action-one.phtml</code> view script. I don't want to render actionOne's view script. I want to render actionTwo's view script. What do I need to do?</p>