private function addDirPathIntoLoaderIfNotExists(array $templateDir)
    {
        $paths = $this->loader->getPaths();
        if ((count($paths) !== count($templateDir)) || (0 < count(array_diff($paths, $templateDir)))) {
            $this->loader->removeAllPaths();
            try {
                $this->loader->setPaths($templateDir);
            } catch (\Twig_Error_Loader $e) {}
        }
    }
private function addDirPathIntoLoaderIfNotExists(array $templateDir)
    {
        $paths = $this->loader->getPaths();
        if ((count($paths) !== count($templateDir)) || (0 < count(array_diff($paths, $templateDir)))) {
            $this->loader->removeAllPaths();
            try {
                $this->loader->setPaths($templateDir);
            } catch (\Twig_Error_Loader $e) {}
        }
    }
private function addDirPathIntoLoaderIfNotExists ( array $ templateDir ) { $ paths = $ this -> loader -> getPaths ( ) ; if ( ( count ( $ paths ) !== count ( $ templateDir ) ) || ( 0 < count ( array_diff ( $ paths , $ templateDir ) ) ) ) { $ this -> loader -> removeAllPaths ( ) ; try { $ this -> loader -> setPaths ( $ templateDir ) ; } catch ( \ Twig_Error_Loader $ e ) { } } }
Add dir path into loader only if it not already exists.

@param array $templateDir
Add dir path into loader only if it not already exists .