mirror of
https://github.com/getgrav/grav.git
synced 2026-07-11 02:33:41 +02:00
refactored to make more reliable
This commit is contained in:
@@ -144,7 +144,19 @@ class Page
|
||||
public function frontmatter($var = null) {
|
||||
|
||||
if ($var) {
|
||||
$this->frontmatter = $var;
|
||||
$this->frontmatter = (string) $var;
|
||||
|
||||
// Update also file object.
|
||||
$file = $this->file();
|
||||
if ($file) {
|
||||
$file->frontmatter((string) $var);
|
||||
}
|
||||
|
||||
// Force content re-processing.
|
||||
$this->id(time().md5($this->filePath()));
|
||||
}
|
||||
if (!$this->frontmatter) {
|
||||
$this->header();
|
||||
}
|
||||
return $this->frontmatter;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user