Skip to main content
Version: Fegg 5.x

Cache::delete

Remove one value

Description​

public static void Cache::delete( string $key )

Removes the file of $key. Nothing happens when there is none.

Arguments​

NameData typeDefaultRemarks
$keystringName of the value

Example​

CMS controller
use Fegg\Tool\Cache;

public function update($id)
{
$this->requirePost();
// ... save the post
Cache::delete('news-latest'); // the top page shows the new post at once
$this->redirect($this->page['prefix'] . '/index/UPDATED');
}