/** * Constructs a new view. * * @param string $name the name of this view * @param string $format the format name * @param Controller $controller the controller object of this view's module */ public function __construct($name, $format, Controller $controller) { $this->name = $name; $this->format = $format; $this->controller = $controller; $this->module = $controller->getModule(); $this->parent = $controller->getParent(); $this->mainTemplate = 'main.' . $format; }
/** * Returns the module name of this model. * * @return string the module name */ protected function getModule() { return $this->controller->getModule(); }