public function setTemplate($template)
    {
        if (!(is_string($template) || $template instanceof TemplateReferenceInterface)) {
            throw new \InvalidArgumentException('The template should be a string or implement TemplateReferenceInterface');
        }
        $this->template = $template;

        return $this;
    }
public function setTemplate($template)
    {
        if (!(is_string($template) || $template instanceof TemplateReferenceInterface)) {
            throw new \InvalidArgumentException('The template should be a string or implement TemplateReferenceInterface');
        }
        $this->template = $template;

        return $this;
    }
public function setTemplate ( $ template ) { if ( ! ( is_string ( $ template ) || $ template instanceof TemplateReferenceInterface ) ) { throw new \ InvalidArgumentException ( 'The template should be a string or implement TemplateReferenceInterface' ) ; } $ this -> template = $ template ; return $ this ; }
Sets template to use for the encoding.

@param string|TemplateReferenceInterface $template

@return View

@throws \InvalidArgumentException if the template is neither a string nor an instance of TemplateReferenceInterface
Sets template to use for the encoding .