Zend\Mvc\View\Http\ExceptionStrategy::setExceptionTemplate PHP Method

setExceptionTemplate() public method

Set the exception template
public setExceptionTemplate ( string $exceptionTemplate ) : ExceptionStrategy
$exceptionTemplate string
return ExceptionStrategy
    public function setExceptionTemplate($exceptionTemplate)
    {
        $this->exceptionTemplate = (string) $exceptionTemplate;
        return $this;
    }

Usage Example

 /**
  * Inject strategy with configured exception_template
  *
  * @param ExceptionStrategy $strategy
  * @param array $config
  */
 private function injectExceptionTemplate(ExceptionStrategy $strategy, array $config)
 {
     $template = isset($config['exception_template']) ? $config['exception_template'] : 'error';
     $strategy->setExceptionTemplate($template);
 }