Skip to content
This repository was archived by the owner on May 7, 2023. It is now read-only.
This repository was archived by the owner on May 7, 2023. It is now read-only.

Make Exception templates overrideable #25

@franklinkim

Description

@franklinkim

Currently the exception template is only expected to be in the rendered app and not any parent classes:

private static function getExceptionTemplate($appClassName)
{
  // exception templates need to find parent stuff too ...
  $appExceptionTempateFile = self::getTemplateBase($appClassName) . DIRECTORY_SEPARATOR . 'exception.tpl';
  if (!file_exists($appExceptionTempateFile)) {
    $appExceptionTempateFile = \Foomo\ROOT . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR .  'Foomo' . DIRECTORY_SEPARATOR .  'MVC' . DIRECTORY_SEPARATOR . 'exception.tpl';
  }
  return new Template('Exception-' . $appClassName, $appExceptionTempateFile);
}

In the extended form you could also check for specific exception templates and then fall back to exception.tpl

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions