Code styling
This commit is contained in:
parent
78fdaa6485
commit
657e098089
|
@ -104,6 +104,23 @@ public function getParent(): ?Bundle
|
||||||
return $this->parent;
|
return $this->parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getArticleTitle(): string
|
||||||
|
{
|
||||||
|
return $this->metadata()->get('title') ?? Str::title(basename($this->path));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getSiteTitle(): string
|
||||||
|
{
|
||||||
|
$title = $this->getArticleTitle();
|
||||||
|
$section = $this->getSection();
|
||||||
|
|
||||||
|
if (!empty($section) && $section->getPath() !== $this->getPath()) {
|
||||||
|
$title .= ' - ' . $section->getArticleTitle();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $title;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a boolean value indicating if there already is a bundle in
|
* Return a boolean value indicating if there already is a bundle in
|
||||||
* specified path
|
* specified path
|
||||||
|
@ -146,23 +163,6 @@ public function repair(): void
|
||||||
$this->save();
|
$this->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getArticleTitle(): string
|
|
||||||
{
|
|
||||||
return $this->metadata()->get('title') ?? Str::title(basename($this->path));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getSiteTitle(): string
|
|
||||||
{
|
|
||||||
$title = $this->getArticleTitle();
|
|
||||||
$section = $this->getSection();
|
|
||||||
|
|
||||||
if (!empty($section) && $section->getPath() !== $this->getPath()) {
|
|
||||||
$title .= ' - ' . $section->getArticleTitle();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $title;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
$renderer = BundleRenderer::getBundleRendererFor($this);
|
$renderer = BundleRenderer::getBundleRendererFor($this);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user