Project

General

Profile

« Previous | Next » 

Revision 1938

Added by darkviper almost 11 years ago

update Twig template engine to version 1.13.1

View differences:

Filesystem.php
12 12
/**
13 13
 * Loads template from the filesystem.
14 14
 *
15
 * @package    twig
16
 * @author     Fabien Potencier <fabien@symfony.com>
15
 * @author Fabien Potencier <fabien@symfony.com>
17 16
 */
18 17
class Twig_Loader_Filesystem implements Twig_LoaderInterface, Twig_ExistsLoaderInterface
19 18
{
......
25 24
     *
26 25
     * @param string|array $paths A path or an array of paths where to look for templates
27 26
     */
28
    public function __construct($paths)
27
    public function __construct($paths = array())
29 28
    {
30
        $this->setPaths($paths);
29
        if ($paths) {
30
            $this->setPaths($paths);
31
        }
31 32
    }
32 33

  
33 34
    /**
......
204 205
            throw new Twig_Error_Loader('A template name cannot contain NUL bytes.');
205 206
        }
206 207

  
208
        $name = ltrim($name, '/');
207 209
        $parts = explode('/', $name);
208 210
        $level = 0;
209 211
        foreach ($parts as $part) {

Also available in: Unified diff