本文整理汇总了PHP中CakeResponse::disableCache方法的典型用法代码示例。如果您正苦于以下问题:PHP CakeResponse::disableCache方法的具体用法?PHP CakeResponse::disableCache怎么用?PHP CakeResponse::disableCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CakeResponse
的用法示例。
在下文中一共展示了CakeResponse::disableCache方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: disableCache
/**
* Forces the user's browser not to cache the results of the current request.
*
* @return void
* @link http://book.cakephp.org/2.0/en/controllers.html#Controller::disableCache
* @deprecated 3.0.0 Will be removed in 3.0. Use CakeResponse::disableCache().
*/
public function disableCache()
{
$this->response->disableCache();
}
示例2: testDisableCache
/**
* Tests the disableCache method
*
*/
public function testDisableCache()
{
$response = new CakeResponse();
$expected = array('Expires' => 'Mon, 26 Jul 1997 05:00:00 GMT', 'Last-Modified' => gmdate("D, d M Y H:i:s") . " GMT", 'Cache-Control' => 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
$response->disableCache();
$this->assertEquals($expected, $response->header());
}