Example #1
0
 /**
  * Creates a controller
  *
  * @param string $controllerName The controller's name (used to load correct model)
  * @param \pff\App $app
  * @param string $action Action to perform
  * @param array $params An array with parameters passed to the action
  * @internal param \pff\Config $cfg App configuration
  */
 public function __construct($controllerName, App $app, $action = 'index', $params = array())
 {
     $this->_controllerName = $controllerName;
     $this->_action = $action;
     $this->_app = $app;
     $this->_config = $app->getConfig();
     //Even if we have an \pff\App reference we keep this for legacy reasons.
     $this->_params = $params;
     $this->_moduleManager = $this->_app->getModuleManager();
     $this->_helperManager = $this->_app->getHelperManager();
     $this->_layout = null;
     $this->_view = array();
     if ($this->_config->getConfigData('orm')) {
         $this->initORM();
     } else {
         $this->_em = null;
     }
     // Set default output to HTML
     $this->_output = new HTMLOut();
     $this->initController();
 }