protected function _compile($template)
    {
        // Prepare template info
        $view_path = $this->_find_view($template);
        $cache_id  = 'blade-' . md5($view_path);
        // Test if a compiled version exists in the cache
        if ($compiled = $this->cache->file->get($cache_id)) {
            // In production, avoid to test if the template was updated
            if (ENVIRONMENT == 'production') {
                return $compiled;
            }
            // Return cache version if the template was not updated
            $meta = $this->cache->file->get_metadata($cache_id);
            if ($meta['mtime'] > filemtime($view_path)) {
                return $compiled;
            }
        }
        // Template content
        $template = file_get_contents($view_path);
        // Compilers
        foreach ($this->_compilers as $compiler) {
            $method   = "_compile_{$compiler}";
            $template = $this->$method($template);
        }
        // Store compiled version in the cache
        $this->cache->file->save($cache_id, $template, $this->cache_time);

        // Return compiled template
        return $template;
    }
protected function _compile($template)
    {
        // Prepare template info
        $view_path = $this->_find_view($template);
        $cache_id  = 'blade-' . md5($view_path);
        // Test if a compiled version exists in the cache
        if ($compiled = $this->cache->file->get($cache_id)) {
            // In production, avoid to test if the template was updated
            if (ENVIRONMENT == 'production') {
                return $compiled;
            }
            // Return cache version if the template was not updated
            $meta = $this->cache->file->get_metadata($cache_id);
            if ($meta['mtime'] > filemtime($view_path)) {
                return $compiled;
            }
        }
        // Template content
        $template = file_get_contents($view_path);
        // Compilers
        foreach ($this->_compilers as $compiler) {
            $method   = "_compile_{$compiler}";
            $template = $this->$method($template);
        }
        // Store compiled version in the cache
        $this->cache->file->save($cache_id, $template, $this->cache_time);

        // Return compiled template
        return $template;
    }
protected function _compile ( $ template ) { // Prepare template info $ view_path = $ this -> _find_view ( $ template ) ; $ cache_id = 'blade-' . md5 ( $ view_path ) ; // Test if a compiled version exists in the cache if ( $ compiled = $ this -> cache -> file -> get ( $ cache_id ) ) { // In production, avoid to test if the template was updated if ( ENVIRONMENT == 'production' ) { return $ compiled ; } // Return cache version if the template was not updated $ meta = $ this -> cache -> file -> get_metadata ( $ cache_id ) ; if ( $ meta [ 'mtime' ] > filemtime ( $ view_path ) ) { return $ compiled ; } } // Template content $ template = file_get_contents ( $ view_path ) ; // Compilers foreach ( $ this -> _compilers as $ compiler ) { $ method = "_compile_{$compiler}" ; $ template = $ this -> $ method ( $ template ) ; } // Store compiled version in the cache $ this -> cache -> file -> save ( $ cache_id , $ template , $ this -> cache_time ) ; // Return compiled template return $ template ; }
Compiles a template and stores it in the cache.

@param string $template

@return string
Compiles a template and stores it in the cache .