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;
    }
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;
    }
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 ; }
Method to set a template object attached to the view.

@param   mixed   An object that implements AnObjectIdentifiable, an object that
implements KIndentifierInterface or valid identifier string

@throws AnDatabaseRowsetException If the identifier is not a table identifier

@return LibBaseViewAbstract
Method to set a template object attached to the view .