public function in(array $dirs, $reset = false)
    {
        $reset and $this->dirs = [];
        array_walk($dirs, function ($dir, $name) {
            if (! is_dir($dir)) {
                throw new InvalidArgumentException('Template folders must be readable paths.');
            }
            if (! is_string($name)) {
                $norm = explode(DIRECTORY_SEPARATOR, $this->normalize($dir));
                $name = implode('.', array_slice($norm, -2));
            }
            $this->dirs[$name] = $dir;
        });
    }
public function in(array $dirs, $reset = false)
    {
        $reset and $this->dirs = [];
        array_walk($dirs, function ($dir, $name) {
            if (! is_dir($dir)) {
                throw new InvalidArgumentException('Template folders must be readable paths.');
            }
            if (! is_string($name)) {
                $norm = explode(DIRECTORY_SEPARATOR, $this->normalize($dir));
                $name = implode('.', array_slice($norm, -2));
            }
            $this->dirs[$name] = $dir;
        });
    }
public function in ( array $ dirs , $ reset = false ) { $ reset and $ this -> dirs = [ ] ; array_walk ( $ dirs , function ( $ dir , $ name ) { if ( ! is_dir ( $ dir ) ) { throw new InvalidArgumentException ( 'Template folders must be readable paths.' ) ; } if ( ! is_string ( $ name ) ) { $ norm = explode ( DIRECTORY_SEPARATOR , $ this -> normalize ( $ dir ) ) ; $ name = implode ( '.' , array_slice ( $ norm , - 2 ) ) ; } $ this -> dirs [ $ name ] = $ dir ; } ) ; }
Set the folders where to search for templates

@param  array                    $dirs
@param  bool                     $reset
@throws InvalidArgumentException
Set the folders where to search for templates