PHP Class Spatie\PartialCache\PartialCache

显示文件 Open project: spatie/laravel-partialcache

Protected Properties

Property Type Description
$cache Illuminate\Contracts\Cache\Repository
$cacheIsTaggable boolean
$cacheKey string
$cacheManager Illuminate\Contracts\Cache\Factory
$enabled boolean
$view Illuminate\Contracts\View\Factory

Public Methods

Method Description
__construct ( Illuminate\Contracts\View\Factory $view, Illuminate\Contracts\Cache\Repository $cache, Illuminate\Contracts\Cache\Factory $cacheManager, Illuminate\Contracts\Config\Repository $config )
cache ( array $data, string $view, array $mergeData = null, integer $minutes = null, string $key = null, string | array $tag = null ) : string Cache a view. If minutes are null, the view is cached forever.
flush ( string $tag = null ) Empty all views linked to a tag or the complete partial cache.
forget ( string $view, string $key = null ) Forget a rendered view.
getCacheKeyForView ( string $view, string $key = null ) : string Create a key name for the cached view.

Protected Methods

Method Description
renderView ( string $view, array $data, array $mergeData ) : string Render a view.

Method Details

__construct() public method

public __construct ( Illuminate\Contracts\View\Factory $view, Illuminate\Contracts\Cache\Repository $cache, Illuminate\Contracts\Cache\Factory $cacheManager, Illuminate\Contracts\Config\Repository $config )
$view Illuminate\Contracts\View\Factory
$cache Illuminate\Contracts\Cache\Repository
$cacheManager Illuminate\Contracts\Cache\Factory
$config Illuminate\Contracts\Config\Repository

cache() public method

Cache a view. If minutes are null, the view is cached forever.
public cache ( array $data, string $view, array $mergeData = null, integer $minutes = null, string $key = null, string | array $tag = null ) : string
$data array
$view string
$mergeData array
$minutes integer
$key string
$tag string | array
return string

flush() public method

Note: Only supported by Taggable cache drivers.
public flush ( string $tag = null )
$tag string

forget() public method

Forget a rendered view.
public forget ( string $view, string $key = null )
$view string
$key string

getCacheKeyForView() public method

Create a key name for the cached view.
public getCacheKeyForView ( string $view, string $key = null ) : string
$view string
$key string
return string

renderView() protected method

Render a view.
protected renderView ( string $view, array $data, array $mergeData ) : string
$view string
$data array
$mergeData array
return string

Property Details

$cache protected_oe property

protected Repository,Illuminate\Contracts\Cache $cache
return Illuminate\Contracts\Cache\Repository

$cacheIsTaggable protected_oe property

protected bool $cacheIsTaggable
return boolean

$cacheKey protected_oe property

protected string $cacheKey
return string

$cacheManager protected_oe property

protected Factory,Illuminate\Contracts\Cache $cacheManager
return Illuminate\Contracts\Cache\Factory

$enabled protected_oe property

protected bool $enabled
return boolean

$view protected_oe property

protected Factory,Illuminate\Contracts\View $view
return Illuminate\Contracts\View\Factory