<?php
|
namespace JVBase\registrar\config;
|
|
|
use JVBase\registrar\Registrar;
|
|
if (!defined('ABSPATH')) {
|
exit;
|
}
|
|
final class Breadcrumbs extends Config {
|
public string $title;
|
public null|string|array $addCrumb = null;
|
|
public function __construct(string $title) {
|
$this->title = $title;
|
}
|
|
public function setTitle(string $title): self {
|
$this->title = $title;
|
return $this;
|
}
|
public function getTitle():string
|
{
|
return $this->title;
|
}
|
|
|
public function setCrumb(string|array $crumb):self
|
{
|
$this->addCrumb = $crumb;
|
return $this;
|
}
|
public function getCrumb():string|array
|
{
|
return $this->addCrumb;
|
}
|
|
function getConfig(): array
|
{
|
$config = [
|
'title' => $this->title,
|
];
|
if (!empty($this->addCrumb)) {
|
$config['addCrumb'] = $this->addCrumb;
|
}
|
return $config;
|
}
|
}
|