public function __construct(IContext &$context, CalendarModel &$model) { parent::__construct($model); $this->_context =& $context; $this->_mode = $context->getParam('mode'); if (is_null($this->_mode)) { $this->_mode = self::MODE_READ; } $this->_range = $context->getParam('range'); if (is_null($this->_range)) { $this->_range = self::VIEW_ANNUAL; } $model->setController($this); }