Bolt\Configuration\ResourceManager::setPath PHP Method

setPath() public method

Set a resource path.
public setPath ( string $name, string $value ) : Eloquent\Pathogen\RelativePathInterface | Eloquent\Pathogen\AbsolutePathInterface
$name string
$value string
return Eloquent\Pathogen\RelativePathInterface | Eloquent\Pathogen\AbsolutePathInterface
    public function setPath($name, $value)
    {
        // If this is a relative path make it relative to root.
        $path = $this->pathManager->create($value);
        if ($path instanceof RelativePathInterface) {
            $path = $path->resolveAgainst($this->paths['root']);
        }
        $path = $path->normalize();
        $this->paths[$name] = $path;
        if (strpos($name, 'path') === false) {
            $this->paths[$name . 'path'] = $path;
        }
        return $path;
    }

Usage Example

 protected function initializeResponder($request)
 {
     $config = new ResourceManager(__DIR__);
     $config->setPath('cache', 'tmp/cache');
     $config->setPath('files', 'images');
     $config->compat();
     $app = new Application(array('resources' => $config));
     $app->register(new \Bolt\Provider\CacheServiceProvider());
     $responder = new ThumbnailResponder($app, $request);
     $responder->initialize();
     return $responder;
 }
All Usage Examples Of Bolt\Configuration\ResourceManager::setPath