public function load($data = array())
    {
        $current = $this->_template->getPath();

        if (!$current) {
            throw new LibBaseTemplateException('There are no template being rendered');
        }

        if (!isset($this->_paths[$current])) {
            $previous = null;
            $search_paths = $this->_template->getSearchPaths();
            $template = null;
            $search_path = null;
            foreach ($search_paths as $path) {
                if (strpos($current, $path) === 0) {
                    $search_path = $path;
                    $template = str_replace($path.'/', '', $current);
                    break;
                }
            }

            if ($search_path) {
                $search_paths = array_slice($search_paths, array_search($search_path, $search_paths) + 1);
                foreach ($search_paths as $path) {
                    $file = $path.'/'.$template;
                    if ($this->_template->findFile($file)) {
                        $previous = $file;
                        break;
                    }
                }
            }

            if (!$previous) {
                throw new LibBaseTemplateException("The {$current} template has no previous");
            }

            $this->_paths[$current] = $previous;
        }

        return $this->_template->loadFile($this->_paths[$current], $data);
    }
public function load($data = array())
    {
        $current = $this->_template->getPath();

        if (!$current) {
            throw new LibBaseTemplateException('There are no template being rendered');
        }

        if (!isset($this->_paths[$current])) {
            $previous = null;
            $search_paths = $this->_template->getSearchPaths();
            $template = null;
            $search_path = null;
            foreach ($search_paths as $path) {
                if (strpos($current, $path) === 0) {
                    $search_path = $path;
                    $template = str_replace($path.'/', '', $current);
                    break;
                }
            }

            if ($search_path) {
                $search_paths = array_slice($search_paths, array_search($search_path, $search_paths) + 1);
                foreach ($search_paths as $path) {
                    $file = $path.'/'.$template;
                    if ($this->_template->findFile($file)) {
                        $previous = $file;
                        break;
                    }
                }
            }

            if (!$previous) {
                throw new LibBaseTemplateException("The {$current} template has no previous");
            }

            $this->_paths[$current] = $previous;
        }

        return $this->_template->loadFile($this->_paths[$current], $data);
    }
public function load ( $ data = array ( ) ) { $ current = $ this -> _template -> getPath ( ) ; if ( ! $ current ) { throw new LibBaseTemplateException ( 'There are no template being rendered' ) ; } if ( ! isset ( $ this -> _paths [ $ current ] ) ) { $ previous = null ; $ search_paths = $ this -> _template -> getSearchPaths ( ) ; $ template = null ; $ search_path = null ; foreach ( $ search_paths as $ path ) { if ( strpos ( $ current , $ path ) === 0 ) { $ search_path = $ path ; $ template = str_replace ( $ path . '/' , '' , $ current ) ; break ; } } if ( $ search_path ) { $ search_paths = array_slice ( $ search_paths , array_search ( $ search_path , $ search_paths ) + 1 ) ; foreach ( $ search_paths as $ path ) { $ file = $ path . '/' . $ template ; if ( $ this -> _template -> findFile ( $ file ) ) { $ previous = $ file ; break ; } } } if ( ! $ previous ) { throw new LibBaseTemplateException ( "The {$current} template has no previous" ) ; } $ this -> _paths [ $ current ] = $ previous ; } return $ this -> _template -> loadFile ( $ this -> _paths [ $ current ] , $ data ) ; }
Render the previous template of the current template.

@param array $data

@return string
Render the previous template of the current template .