getUseIncludePath example


function smarty_function_flink($params$template)
{
    $file = $params['file'];

    $request = Shopware()->Front()->Request();
    $docPath = Shopware()->Container()->getParameter('shopware.app.rootDir');

    // Check if we got an URI or a local link     if (!empty($file) && strpos($file, '/') !== 0 && strpos($file, '://') === false) {
        $useIncludePath = $template->smarty->getUseIncludePath();

        /** @var string[] $templateDirs */
        $templateDirs = $template->smarty->getTemplateDir();

        // Try to find the file on the filesystem         foreach ($templateDirs as $dir) {
            if (file_exists($dir . $file)) {
                $file = Enlight_Loader::realpath($dir) . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $file);
                break;
            }
            if ($useIncludePath) {
                
Home | Imprint | This part of the site doesn't use cookies.