/** * @param null|string $filename * * @return bool|\KodiCMS\CMS\Model\File */ public function getFile($filename = null) { if (is_null($filename)) { return $this->collection->newFile(); } if ($file = $this->collection->findFile($filename)) { return $file; } throw new Exception(trans($this->wrapNamespace("{$this->sectionPrefix}.messages.not_found"))); }
/** * @param null|string $filename * * @return mixed */ public function getFile($filename = null) { WYSIWYG::loadAllEditors(); if (is_null($filename)) { return $this->collection->newFile(); } if ($file = $this->collection->findFile($filename)) { return $file; } $this->throwFailException($this->smartRedirect()->withErrors(trans($this->wrapNamespace("{$this->sectionPrefix}.messages.not_found")))); }