Sets the view files path.

@since 1.0.0

@param FilePathInterface $viewPath The view files path.

@throws InvalidFilePathException If the $viewPath parameter is invalid.
164723
public function setViewPath(FilePathInterface $viewPath): void
    {
        if (!$viewPath->isDirectory()) {
            throw new InvalidFilePathException('View path "' . $viewPath . '" is not a directory.');
        }

        try {
            $this->viewPath = $this->documentRoot->withFilePath($viewPath);
        } catch (FilePathLogicException $e) {
            throw new InvalidFilePathException($e->getMessage());
        }
    }
671061
public function setControllerViewPath($controllerName)
    {
        $this->controllerViewPath = str_replace('\\','/',strtolower($controllerName));
        $this->controllerFullViewPath = $this->_viewsDir . $this->controllerViewPath;
    }
962776
protected function checkFilePath($filePath)
	{
	    $filePath = rtrim($filePath, '/\\');
	    if (!is_dir($filePath)) {
			mkdir($filePath, 0755, true);
		}
        
		if (!is_writable($filePath)) {
			throw new \RuntimeException(sprintf('The base cache path `%s` is not writable.', $filePath));
		}

		return true;
	}
133340
public function setRunPath(string $runPath) : void
    {
        if (!file_exists($runPath)) {
            throw new ManagerException('Invalid run path. Folder not found.');
        }
        $this->runPath = $runPath;
    }
161798
public function setPath(File $path) {
		$this->path = $path;
		if ($this->isCreateIfNotExists() && !$path->isFile()) {
			$path->getParent()->mkdir();
			$path->write("");
			$this->setCreateDefault(true);
			if (!$path->isFile()) {
				throw new FileNotFoundException($path);
			}
		}
		$this->content = $path->getContent();
	}
178954
protected function setFilePath($filePath)
	{
		if ( ! is_string($filePath))
		{
			throw new \InvalidArgumentException('File path must be a string type.');
		}
		
		if (preg_match('~^(\w+:)?//~', $filePath) || is_link($filePath))
		{
			throw new \InvalidArgumentException('File path must be a local path.');
		}
		
		$filePath = realpath($filePath);
		
		if ( ! is_file($filePath))
		{
			throw new TranscoderException('File path not found.');
		}
		
		$this->filePath = $filePath;
		
		return $this;
	}
68524
public function setCachePath(string $path)
    {
        $rpath = substr($path, 0, 6) === "vfs://" ? $path : realpath($path);
        if (empty($rpath) || !file_exists($path))
            throw new InvalidArgumentException("Path does not exist: " . $rpath);
        $this->cache_path = $rpath;
    }
1119657
public static function setDefaultMagicFile($filePath = null)
    {
        if (!is_null($filePath) && !file_exists($filePath)) {
            throw new FileNotFoundException('File does not exist or is not readable: ' . $filePath);
        }
        self::$defaultMagicFile = $filePath;
    }
1246481
private function resolveViewPath($viewPath)
    {
        $path = realpath($this->_viewsDir . dirname($viewPath)) . DIRECTORY_SEPARATOR . basename($viewPath);
        return $path;
    }
1176884
private function inflate($filePath)
    {
        $currentDirectory = rtrim(dirname($this->currentView), self::DS);
        $currentDirectory .= self::DS;
        if (substr($filePath, -6, 6) != '.phtml') {
            $filePath .= '.phtml';
        }

        $searchPath = realpath($currentDirectory . $filePath);
        if ($searchPath != false && file_exists($searchPath)) {
            $content = @include $searchPath;
            if (!$content) {
                // @codeCoverageIgnoreStart
                $e = new ViewFileNotFoundException('Unable to inflate file "' . $searchPath . '"');
                $e->setAdditionalData('View Path: ', $searchPath);
                throw $e;
                // @codeCoverageIgnoreEnd
            }
            return;
        }

        // @codeCoverageIgnoreStart
        $e = new ViewFileNotFoundException('Invalid view file path, expected: "' . $currentDirectory . $filePath . '"');
        $e->setAdditionalData('View Path Checked: ', $currentDirectory . $filePath);
        throw $e;
        // @codeCoverageIgnoreEnd
    }
1122325
public function setViewPath($view)
    {
        $this->layout->layout = $this->viewPath->setUp($this->layout->layout, $view);

        return $this;
    }
197478
public function renderView($viewPath, array $data = null)
    {
        $this->setView($viewPath);

        !$data or extract($data);
        ob_start();

        if (file_exists(rtrim(
                $this->getViewPath(), $this->getFileExt()
            ) . $this->getFileExt())) {

            /** @noinspection PhpIncludeInspection */
            include rtrim(
                    $this->getViewPath(), $this->getFileExt()
                ) . $this->getFileExt();

        } elseif (file_exists(rtrim(
                $this->getViewFallbackPath(), $this->getFileExt()
            ) . $this->getFileExt())) {

            /** @noinspection PhpIncludeInspection */
            include rtrim(
                    $this->getViewFallbackPath(), $this->getFileExt()
                ) . $this->getFileExt();

        } else {
            throw new ViewNotFoundException('View ' . rtrim(
                    $this->getViewPath(), $this->getFileExt()
                ) . $this->getFileExt() . ' not found');
        }

        $rendered = ob_get_contents();
        ob_end_clean();

        return $rendered;
    }
429196
public function setFilePath($filePath)
    {
        Assert::stringNotEmpty($filePath, 'The factory file path must be a non-empty string. Got: %s');

        $this->setDirectory(Path::getDirectory($filePath));
        $this->setFileName(Path::getFilename($filePath));

        return $this;
    }
32586
public function setPath($path = null)
    {
        if (is_string($path)) {
            if ($path{0} !== '/') {
                $path = "/$path";
            }
        }
        else if (!is_null($path)) {
            throw new \InvalidArgumentException(
                "invalid value provided for 'path'; ".
                " expecting a string or null"
            );
        }
        $this->path = $path;
    }
622148
public function view($viewPath)
    {
        if (is_a($viewPath, ViewInterface::class)) {
            $this->view_path = $viewPath;
            return $this;
            // Old string approach - will be deprecated soon
        } elseif (is_string($viewPath)) {
            //elapsed('['.$this->id.'] Setting view context: ['.$viewPath.']');
            // Find full path to view file
            $this->view_path = $this->findView($viewPath);

            // If we have not found view in current module but we have parent module
            if (isset($this->parent) && $this->view_path === false) {
                //elapsed('['.$this->id.'] Cannot set view['.$viewPath.'] - passing it to parent['.$this->parent->id.']');

                /*
                 * Call parent module view setting and return PARENT module to chain
                 * actually switching current module in chain
                 */
                return $this->parent->view($viewPath);
            } else { // Call default module behaviour
                // Call default module behaviour
                parent::view($this->view_path);

                return $this;
            }
        }
    }
401897
protected function findInPaths($name, array $paths)
    {
        foreach ($paths as $path) {
            foreach ($this->getPossibleViewFiles($name) as $fileName) {
                $viewPath = $path .DS .$fileName;

                if ($this->files->exists($viewPath)) {
                    return $viewPath;
                }
            }
        }

        throw new \InvalidArgumentException("View [$name] not found.");
    }
804156
public static void setInitFilePath(String filePath) {
		filePath=getPropertiesFilePath(filePath);
		
		if (staticFileProperties == null) {
			staticFileProperties=new FileProperties(filePath);
		} else {
			staticFileProperties.setInitFilePath(filePath);
		}
	}