コード例 #1
0
ファイル: Presenter.php プロジェクト: pdostal/nette-blog
 /**
  * Attempts to cache the sent entity by its last modification date.
  * @param  string|int|DateTime  last modified time
  * @param  string strong entity tag validator
  * @param  mixed  optional expiration time
  * @return void
  * @throws Nette\Application\AbortException
  */
 public function lastModified($lastModified, $etag = NULL, $expire = NULL)
 {
     if ($expire !== NULL) {
         $this->httpResponse->setExpiration($expire);
     }
     if (!$this->httpContext->isModified($lastModified, $etag)) {
         $this->terminate();
     }
 }
コード例 #2
0
ファイル: Presenter.php プロジェクト: voda/application
 /**
  * Attempts to cache the sent entity by its last modification date.
  * @param  string|int|\DateTimeInterface  last modified time
  * @param  string strong entity tag validator
  * @param  mixed  optional expiration time
  * @return void
  * @throws Nette\Application\AbortException
  */
 public function lastModified($lastModified, $etag = NULL, $expire = NULL)
 {
     if ($expire !== NULL) {
         $this->httpResponse->setExpiration($expire);
     }
     $helper = new Http\Context($this->httpRequest, $this->httpResponse);
     if (!$helper->isModified($lastModified, $etag)) {
         $this->terminate();
     }
 }