Skip to content

Instantly share code, notes, and snippets.

@till
Created March 29, 2010 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save till/348449 to your computer and use it in GitHub Desktop.
Save till/348449 to your computer and use it in GitHub Desktop.
<?php
abstract class MyController extends Zend_Controller_Action
{
public function render($view)
{
if (strstr($view, '/')) {
$file = $view . '.phtml';
} else {
$file = $this->getRequest()->getControllerName() . "/{$view}.phtml";
}
$this->getResponse()->setBody(
$this->view->render($file)
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment