/** * {@inheritDoc} * * Adds fallback functionality, if layout is not found it uses QuickAppsCMS's * `default.ctp` as it will always exists. */ protected function _getLayoutFileName($name = null) { try { $filename = parent::_getLayoutFileName($name); } catch (\Exception $e) { $filename = parent::_getLayoutFileName('default'); } return $filename; }
protected function _getLayoutFileName($name = null) { // @codingStandardsIgnoreEnd $rethrow = new \Exception('You\'re not supposed to get here'); foreach ($this->extensions as $extension) { $this->_ext = $extension; try { return parent::_getLayoutFileName($name); } catch (\Exception $exception) { $rethrow = $exception; } } throw $rethrow; }
/** * Returns layout filename for this template as a string. * * @param string|null $name * @return string */ protected function _getLayoutFileName($name = null) { $rethrow = new \Exception("You're not supposed to get here."); foreach ($this->extensions as $extension) { $this->_ext = $extension; try { return parent::_getLayoutFileName($name); } catch (\Exception $e) { $rethrow = $e; } } throw $rethrow; }