Zend\Mvc\View\Http\RouteNotFoundStrategy::setNotFoundTemplate PHP Метод

setNotFoundTemplate() публичный Метод

Get template for not found conditions
public setNotFoundTemplate ( string $notFoundTemplate ) : RouteNotFoundStrategy
$notFoundTemplate string
Результат RouteNotFoundStrategy
    public function setNotFoundTemplate($notFoundTemplate)
    {
        $this->notFoundTemplate = (string) $notFoundTemplate;
        return $this;
    }

Usage Example

 /**
  * Inject strategy with configured not_found_template.
  *
  * @param RouteNotFoundStrategy $strategy
  * @param array $config
  */
 private function injectNotFoundTemplate(RouteNotFoundStrategy $strategy, array $config)
 {
     $template = isset($config['not_found_template']) ? $config['not_found_template'] : '404';
     $strategy->setNotFoundTemplate($template);
 }