/** * 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; }
/** * Constructs a new model. * * This constructor stores a reference to the controller this model is assigned to. Furthermore * it stores the parent from the controller. * * @param Controller $controller the controller */ public function __construct(Controller $controller) { $this->controller = $controller; $this->parent = $controller->getParent(); }