public function __construct(array $config = array()) { parent::__construct($config); if (empty($this->_config['name'])) { $this->_config['name'] = __CLASS__; } if (empty($this->_config['table'])) { $this->_config['table'] = Inflector::tableize(__CLASS__); } $this->_db = Database::getDriver($this->_config['database']); }
/** * Configure the Controller and store the View object. * * @access public * @param array $config * @param View $View * @return void */ public final function __construct(array $config, View $View) { parent::__construct($config); // Get the routed path and save it to the view $template = array('container' => $this->_config['container'], 'controller' => $this->_config['controller'], 'action' => $this->_config['action']); if (!empty($this->_config['ext'])) { $template['ext'] = $this->_config['ext']; } // Setup the View object $this->View = $View; $this->View->render(array('template' => $template)); }
/** * Store the parent Controller. Overwrite the default __construct(). * * @access public * @param Controller $Controller * @return void */ public function __construct(Controller $Controller) { parent::__construct(); $this->Controller = $Controller; $this->run(); }
/** * Store the configuration and load the Controller and View objects. * * @access public * @param array $config * @return void */ public function __construct(array $config = array()) { parent::__construct($config); $this->View = $this->loadView(); $this->Controller = $this->loadController(); }