Skip to content

Commit

Permalink
Merge pull request #474 from chokeslam/4.0pagebuilder
Browse files Browse the repository at this point in the history
[Fixed] 修正windwalker 4.0 pagebuilder 儲存時不會更新 cache 檔的問題
  • Loading branch information
asika32764 authored Dec 12, 2023
2 parents ce5944c + 3764007 commit 8271bde
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Module/Admin/Page/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public function savePage(
$repository->save($item);

// Cache
$pageBuilder->renderByEntityAndCache($entity);
$pageBuilder->renderByEntityAndCache($entity, true);

return [
'item' => $entity,
Expand Down
4 changes: 2 additions & 2 deletions src/PageBuilder/PageBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ public function renderPage(array $rows): string
return $html;
}

public function renderByEntityAndCache(Page $page): string
public function renderByEntityAndCache(Page $page, bool $refresh = false): string
{
$cache = $this->getCacheFile($page->getId());

if ($cache->isFile()) {
if ($cache->isFile() && !$refresh) {
return (string) $cache->read();
}

Expand Down

0 comments on commit 8271bde

Please sign in to comment.