FOF30\View\View::addTemplatePath PHP Method

addTemplatePath() protected method

Adds to the search path for templates and resources.
protected addTemplatePath ( mixed $path ) : void
$path mixed The directory or stream, or an array of either, to search.
return void
    protected function addTemplatePath($path)
    {
        // Just force to array
        settype($path, 'array');
        // Loop through the path directories
        foreach ($path as $dir) {
            // No surrounding spaces allowed!
            $dir = trim($dir);
            // Add trailing separators as needed
            if (substr($dir, -1) != DIRECTORY_SEPARATOR) {
                // Directory
                $dir .= DIRECTORY_SEPARATOR;
            }
            // Add to the top of the search dirs
            array_unshift($this->templatePaths, $dir);
        }
    }