/** * Create a new page with a reference to its component and the file in which * it is defined. * * Also, by default, the page will be configured to look for view scripts * in the view-scripts sub-folder of its component. * * @param ComponentInterface $component * @param Request $request * @param string $viewScriptPath */ public function __construct(ComponentInterface $component, Request $request, $viewScriptPath = null) { $this->component = $component; $this->view = Pimple::getResource('view'); $this->request = $request ?: Pimple::getResource('dewdrop-request'); if (null === $viewScriptPath) { $viewScriptPath = $this->component->getPath() . '/view-scripts'; } $this->viewScriptPath = $viewScriptPath; $this->view->setScriptPath($this->viewScriptPath)->helper('AdminUrl')->setPage($this); }