private function resolvePartialPath($viewPath)
    {
        $tempViewPath = str_replace($this->getPartialsDir(), '', $viewPath);

        if (strpos($tempViewPath, '../') === 0 || strpos($tempViewPath, '/../') === 0) {
            return $this->resolveRelativePath($tempViewPath);
        } else if (strpos($tempViewPath, './') === 0) {
            return $this->resolveLocalPath($tempViewPath);
        } else if (!in_array(dirname($tempViewPath), ['.','..'])
            && file_exists(dirname($tempViewPath))) {
            return $tempViewPath;
        }

        return $this->resolveGlobalPath($tempViewPath);
    }
private function resolvePartialPath($viewPath)
    {
        $tempViewPath = str_replace($this->getPartialsDir(), '', $viewPath);

        if (strpos($tempViewPath, '../') === 0 || strpos($tempViewPath, '/../') === 0) {
            return $this->resolveRelativePath($tempViewPath);
        } else if (strpos($tempViewPath, './') === 0) {
            return $this->resolveLocalPath($tempViewPath);
        } else if (!in_array(dirname($tempViewPath), ['.','..'])
            && file_exists(dirname($tempViewPath))) {
            return $tempViewPath;
        }

        return $this->resolveGlobalPath($tempViewPath);
    }
private function resolvePartialPath ( $ viewPath ) { $ tempViewPath = str_replace ( $ this -> getPartialsDir ( ) , '' , $ viewPath ) ; if ( strpos ( $ tempViewPath , '../' ) === 0 || strpos ( $ tempViewPath , '/../' ) === 0 ) { return $ this -> resolveRelativePath ( $ tempViewPath ) ; } else if ( strpos ( $ tempViewPath , './' ) === 0 ) { return $ this -> resolveLocalPath ( $ tempViewPath ) ; } else if ( ! in_array ( dirname ( $ tempViewPath ) , [ '.' , '..' ] ) && file_exists ( dirname ( $ tempViewPath ) ) ) { return $ tempViewPath ; } return $ this -> resolveGlobalPath ( $ tempViewPath ) ; }
Resolves path to partial

application->view->partialsDir option is optional
When partialsDir is not set in configuration, then by default partialsDir is the same like current viewsDir
Otherwise, when partialsDir is set to for example directory app/layouts/partials then partial function loads
global partials from this directory

<code>
//remember about trailing slashes
'application' => array(
...
'view' => array(
'layout' => 'main',
'layoutsDir' => APP_ROOT . '/app/layouts/',
'partialsDir' => APP_ROOT . '/app/layouts/partials/', //[optional]
...
)
)
...
</code>
Usage:
-   Relative partial
<code>
{# somewhere in module view #}
{{ partial('../../../layouts/partials/header/navigation') }
# goes to APP_ROOT/app/layouts/partials/header/navigation.volt
</code>
<code>
{# somewhere in module view eg. Test/views/index/index.volt #}
{{ partial('./frontend/foo/partials/other.volt') }
# goes to APP_ROOT/app/modules/Test/views/frontend/foo/partials/other.volt
</code>

-   Global partial
<code>
{{ partial('header/navigation') }}
# when partialsDir is set to APP_ROOT/app/layouts/partials
# it goes to APP_ROOT/app/layouts/partials/header/navigation.volt
# otherwise it is looking for view inside current viewsDir, so: APP_ROOT/app/modules/Test/views/header/navigation.volt
</code>

-    Local partial in module Test, controller Index (app/modules/Test/views/index/)
<code>
{{ partial('./frontend/index/partials/content/heading') }}
# goes to APP_ROOT/app/modules/Test/views/frontend/index/partials/content/heading.volt
</code>

-    Absolute path
<code>
{{ partial(constant("APP_ROOT") ~ "/app/layouts/partials/header/navigation.volt") }}
</code>

@param $viewPath
@return string
Resolves path to partial