public function __construct(View $viewer) { $this->viewer = $viewer; $this->controller = $viewer->getController(); if ($this->controller) { $this->record = $this->controller->getRecord(); } parent::__construct(); }