/** * Add the page and page type assets. * * @param PageInterface $page * @throws \Exception */ public function add(PageInterface $page) { /* @var EditorFieldTypePresenter $js */ /* @var EditorFieldTypePresenter $css */ $js = $page->getFieldTypePresenter('js'); $css = $page->getFieldTypePresenter('css'); $this->asset->add('styles.css', $css->path()); $this->asset->add('scripts.js', $js->path()); $type = $page->getType(); $js = $type->getFieldTypePresenter('js'); $css = $type->getFieldTypePresenter('css'); $this->asset->add('styles.css', $css->path()); $this->asset->add('scripts.js', $js->path()); }