Documentation

BladeOneCache

trait BladeOneCache Copyright (c) 2016 Jorge Patricio Castro Castillo MIT License. Don't delete this comment, its part of the license.

Extends the tags of the class BladeOne. Its optional It adds the next tags to the template @ cache([cacheid],[duration=86400]). The id is optional. The duration of the cache is in seconds // content here @ endcache() It also adds a new function (optional) to the business or logic layer if ($blade->cacheExpired('hellocache',1,5)) { //'helloonecache' =template, =1 id cache, 5=duration (seconds) // cache expired, so we should do some stuff (such as read from the database) }

Tags
version
1.4

2016-06-25

link
https://github.com/EFTEC/BladeOne

Table of Contents

$cacheRunning  : mixed
$curCacheDuration  : mixed
$curCacheId  : mixed
$curCachePosition  : mixed
$cacheExpired  : mixed
cacheEnd()  : mixed
cacheExpired()  : bool
Returns true if the cache expired (or doesn't exist), otherwise false.
cacheStart()  : mixed
compileCache()  : mixed
compileEndCache()  : mixed

Properties

Methods

cacheEnd()

public cacheEnd() : mixed
Return values
mixed

cacheExpired()

Returns true if the cache expired (or doesn't exist), otherwise false.

public cacheExpired(string $templateName, string $id, int $cacheDuration) : bool
Parameters
$templateName : string

name of the template to use (such hello for template hello.blade.php)

$id : string

(id of cache, optional, if not id then it adds automatically a number)

$cacheDuration : int

(duration of the cache in seconds)

Return values
bool

(return if the cache expired)

cacheStart()

public cacheStart([mixed $id = "" ][, mixed $cacheDuration = 86400 ]) : mixed
Parameters
$id : mixed = ""
$cacheDuration : mixed = 86400
Return values
mixed

compileCache()

public compileCache(mixed $expression) : mixed
Parameters
$expression : mixed
Return values
mixed

compileEndCache()

public compileEndCache(mixed $expression) : mixed
Parameters
$expression : mixed
Return values
mixed

Search results