DOCS Fix bad usage of HTTPCacheControl::inst()

This commit is contained in:
Daniel Hensby 2018-06-13 14:22:35 +01:00
parent 1acb80851c
commit 936fd775c5
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E
2 changed files with 6 additions and 6 deletions

View File

@ -103,7 +103,7 @@ class Page_Controller extends ContentController
{
public function init()
{
HTTPCacheControl::inst()
HTTPCacheControl::singleton()
->enableCache()
->setMaxAge(60); // 1 minute
@ -130,7 +130,7 @@ class MyPage_Controller extends Page_Controller
public function myprivateaction($request)
{
$response = $this->myPrivateResponse();
HTTPCacheControl::inst()
HTTPCacheControl::singleton()
->disableCache();
return $response;
@ -160,7 +160,7 @@ class Page_Controller extends ContentController
{
public function init()
{
HTTPCacheControl::inst()
HTTPCacheControl::singleton()
->enableCache($force=true) // DANGER ZONE
->setMaxAge(60); // 1 minute

View File

@ -113,7 +113,7 @@ class Page_Controller extends ContentController
public function init()
{
- HTTP::set_cache_age(60);
+ HTTPCacheControl::inst()
+ HTTPCacheControl::singleton()
+ ->enableCache()
+ ->setMaxAge(60); // 1 minute
@ -141,7 +141,7 @@ class MyPage_Controller extends Page_Controller
{
$response = $this->myPrivateResponse();
- HTTP::set_cache_age(0);
+ HTTPCacheControl::inst()
+ HTTPCacheControl::singleton()
+ ->disableCache();
@ -173,7 +173,7 @@ class Page_Controller extends ContentController
public function init()
{
- HTTP::set_cache_age(60);
+ HTTPCacheControl::inst()
+ HTTPCacheControl::singleton()
+ ->enableCache($force=true) // DANGER ZONE
+ ->setMaxAge(60); // 1 minute