public function setTemplate($template)
    {
        if (is_string($template)) {
            $template = new TemplateView($template);
        }
        $template->mergeData([
            'layout' => $this
        ]);
        $this->addChild(new Part($template, 'template'));
        return $this;
    }
public function setTemplate($template)
    {
        if (is_string($template)) {
            $template = new TemplateView($template);
        }
        $template->mergeData([
            'layout' => $this
        ]);
        $this->addChild(new Part($template, 'template'));
        return $this;
    }
public function setTemplate ( $ template ) { if ( is_string ( $ template ) ) { $ template = new TemplateView ( $ template ) ; } $ template -> mergeData ( [ 'layout' => $ this ] ) ; $ this -> addChild ( new Part ( $ template , 'template' ) ) ; return $ this ; }
Sets layout template.

@param TemplateView|string $template
@return $this
Sets layout template .