Skip to content

Instantly share code, notes, and snippets.

@davidreuss
Created February 24, 2009 12:28
Show Gist options
  • Save davidreuss/69546 to your computer and use it in GitHub Desktop.
Save davidreuss/69546 to your computer and use it in GitHub Desktop.
<?php
class MyController extends Zend_Controller_Action {
public $contexts = array(
'request' => array('json', 'html')
);
public function requestAction() {
$this->view->fields = Foo::getFields();
// Here i want to build the form - but ONLY if context is 'html'
// Should there be an if statement right here, or could it be configured
// Somewhere else?
// Something like:
// if ($context == 'html') {
// $this->view->form = new My_Form();
// }
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment