public function mediaDirFunc($media_dir)
    {
        /** @var UniformResourceLocator $locator */
        $locator = $this->grav['locator'];

        if ($locator->isStream($media_dir)) {
            $media_dir = $locator->findResource($media_dir);
        }

        if ($media_dir && file_exists($media_dir)) {
            return new Media($media_dir);
        }

        return null;
    }
public function mediaDirFunc($media_dir)
    {
        /** @var UniformResourceLocator $locator */
        $locator = $this->grav['locator'];

        if ($locator->isStream($media_dir)) {
            $media_dir = $locator->findResource($media_dir);
        }

        if ($media_dir && file_exists($media_dir)) {
            return new Media($media_dir);
        }

        return null;
    }
public function mediaDirFunc ( $ media_dir ) { /** @var UniformResourceLocator $locator */ $ locator = $ this -> grav [ 'locator' ] ; if ( $ locator -> isStream ( $ media_dir ) ) { $ media_dir = $ locator -> findResource ( $ media_dir ) ; } if ( $ media_dir && file_exists ( $ media_dir ) ) { return new Media ( $ media_dir ) ; } return null ; }
Process a folder as Media and return a media object

@param string $media_dir
@return Media|null
Process a folder as Media and return a media object