src/Assets.php
public function findFallbackAsset($asset, $Folder = null)
    {
        $folderEmpty = empty($Folder);
        $folderAllowFallback = ! empty($Folder) && $Folder->getFallback();

        if ($folderEmpty || $folderAllowFallback) {
            $fallbackPath = $this->engine->getDirectory();

            $fallbackPath = $this->removeViewFromPath($fallbackPath);
            if (file_exists($fallbackPath . DS . $asset)) {
                $this->createSymlink($fallbackPath);

                return '/' . $this->assetDir . '/' . $this->asset['asset'];
            }
        }

        return false;
    }
public function findFallbackAsset($asset, $Folder = null)
    {
        $folderEmpty = empty($Folder);
        $folderAllowFallback = ! empty($Folder) && $Folder->getFallback();

        if ($folderEmpty || $folderAllowFallback) {
            $fallbackPath = $this->engine->getDirectory();

            $fallbackPath = $this->removeViewFromPath($fallbackPath);
            if (file_exists($fallbackPath . DS . $asset)) {
                $this->createSymlink($fallbackPath);

                return '/' . $this->assetDir . '/' . $this->asset['asset'];
            }
        }

        return false;
    }
public function findFallbackAsset ( $ asset , $ Folder = null ) { $ folderEmpty = empty ( $ Folder ) ; $ folderAllowFallback = ! empty ( $ Folder ) && $ Folder -> getFallback ( ) ; if ( $ folderEmpty || $ folderAllowFallback ) { $ fallbackPath = $ this -> engine -> getDirectory ( ) ; $ fallbackPath = $ this -> removeViewFromPath ( $ fallbackPath ) ; if ( file_exists ( $ fallbackPath . DS . $ asset ) ) { $ this -> createSymlink ( $ fallbackPath ) ; return '/' . $ this -> assetDir . '/' . $ this -> asset [ 'asset' ] ; } } return false ; }
find the fallback asset

@param   string          Full path to the main asset
@param   Object          Plates\Folder Object, so we can check for fallback => true
@return  string|bool     url path to asset or bool false
find the fallback asset