public function addLayout($name)
    {
        if (!$this->template) {
            return;
        }
        // TODO: change to functionExists()
        if (method_exists($this, $lfunc = 'layout_'.$name)) {
            if ($this->template->is_set($name)) {
                $this->$lfunc();
            }
        }

        return $this;
    }