code/libraries/joomlatools/library/template/engine/koowa.php
public function loadString($source, $url = null)
    {
        $name = crc32($url ?: $source);

        if(!$file = $this->isCached($name))
        {
            //Compile the template
            $source = $this->_compile($source);

            if($source === false) {
                throw new RuntimeException(sprintf('The template content cannot be compiled.'));
            }

            $file = $this->cache($name, $source);
        }

        $this->_source = $file;

        //Push the template on the stack
        array_push($this->_stack, $url);

        //Store the location
        if($url) {
            $this->_locations[$url] = $file;
        }

        return $this;
    }
public function loadString($source, $url = null)
    {
        $name = crc32($url ?: $source);

        if(!$file = $this->isCached($name))
        {
            //Compile the template
            $source = $this->_compile($source);

            if($source === false) {
                throw new RuntimeException(sprintf('The template content cannot be compiled.'));
            }

            $file = $this->cache($name, $source);
        }

        $this->_source = $file;

        //Push the template on the stack
        array_push($this->_stack, $url);

        //Store the location
        if($url) {
            $this->_locations[$url] = $file;
        }

        return $this;
    }
public function loadString ( $ source , $ url = null ) { $ name = crc32 ( $ url ? : $ source ) ; if ( ! $ file = $ this -> isCached ( $ name ) ) { //Compile the template $ source = $ this -> _compile ( $ source ) ; if ( $ source === false ) { throw new RuntimeException ( sprintf ( 'The template content cannot be compiled.' ) ) ; } $ file = $ this -> cache ( $ name , $ source ) ; } $ this -> _source = $ file ; //Push the template on the stack array_push ( $ this -> _stack , $ url ) ; //Store the location if ( $ url ) { $ this -> _locations [ $ url ] = $ file ; } return $ this ; }
Set the template source from a string

@param  string  $source The template source
@throws RuntimeException If the template could not be compiled
@return KTemplateEngineKoowa
Set the template source from a string