cms/app/Presenters/DocumentTitlePresenter.php

20 lines
412 B
PHP

<?php
namespace App\Presenters;
use Illuminate\Support\Facades\View;
class DocumentTitlePresenter
{
public function get()
{
$siteName = app('SiteName')->get();
$titleSection = trim(View::getSection('title'));
if(View::hasSection('title') && $titleSection) {
return $titleSection . ' - ' . $siteName;
} else {
return $siteName;
}
}
}