public function setTemplate($template)
    {
        if (! ($template instanceof LibBaseTemplateAbstract)) {
            if (is_string($template) && strpos($template, '.') === false) {
                $identifier = clone $this->getIdentifier();
                $identifier->path = array('template');
                $identifier->name = $template;
            } else {
                $identifier = $this->getIdentifier($template);
            }

            if ($identifier->path[0] != 'template') {
                throw new KViewException('Identifier: '.$identifier.' is not a template identifier');
            }

            register_default(array('identifier' => $identifier, 'prefix' => $this, 'name' => array('Template'.ucfirst($this->getName()), 'TemplateDefault')));

            $template = $identifier;
        }

        $this->_template = $template;

        return $this;
    }