Skip to content

Commit

Permalink
chore: Use MetaData service’s getAppName method rather than directl…
Browse files Browse the repository at this point in the history
…y accessing config value
  • Loading branch information
hellopablo committed May 14, 2024
1 parent ea50b5f commit e905d6e
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Common/Service/MetaData.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function getTitles(): Service\MetaData\Collection
array_filter([
$this->title,
$this->isTitleAppendAppName()
? Config::get('APP_NAME')
? $this->getAppName()
: null,
])
)
Expand Down
2 changes: 1 addition & 1 deletion views/errors/html/401.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
-->
<html lang="en">
<head>
<title>401 Unauthorised - <?=\Nails\Config::get('APP_NAME')?></title>
<title>401 Unauthorised - <?=\Nails\Factory::service('MetaData')->getAppName()?></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php

Expand Down
2 changes: 1 addition & 1 deletion views/errors/html/404.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-->
<html lang="en">
<head>
<title>404 Page Not Found - <?=\Nails\Config::get('APP_NAME')?></title>
<title>404 Page Not Found - <?=\Nails\Factory::service('MetaData')->getAppName()?></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php

Expand Down
2 changes: 1 addition & 1 deletion views/errors/html/500.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ function keyValueSection($title, $data)
<!DOCTYPE html>
<html lang="en">
<head>
<title>An Error Occurred - <?=\Nails\Config::get('APP_NAME')?></title>
<title>An Error Occurred - <?=Factory::service('MetaData')->getAppName()?></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php

Expand Down
2 changes: 1 addition & 1 deletion views/errors/html/maintenance.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-->
<html lang="en">
<head>
<title>Down For Maintenance - <?=\Nails\Config::get('APP_NAME')?></title>
<title>Down For Maintenance - <?=\Nails\Factory::service('MetaData')->getAppName()?></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="refresh" content="10">
<?php
Expand Down
2 changes: 1 addition & 1 deletion views/structure/footer/nails-default.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="row">
<p class="text-center">
<small>
&copy; <?=\Nails\Config::get('APP_NAME') . ' ' . date('Y')?>
&copy; <?=Factory::service('MetaData')->getAppName() . ' ' . date('Y')?>
<br />
<?=lang('nails_footer_powered_by', [\Nails\Config::get('NAILS_PACKAGE_URL'), \Nails\Config::get('NAILS_PACKAGE_NAME')])?>
</small>
Expand Down
2 changes: 1 addition & 1 deletion views/structure/header/nails-default.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div class="container">
<div class="row text-center" style="margin-top:1em;">
<h1>
<?=anchor('', Config::get('APP_NAME'), 'style="text-decoration:none;color:inherit;"')?>
<?=anchor('', Factory::service('MetaData')->getAppName(), 'style="text-decoration:none;color:inherit;"')?>
</h1>
</div>
<hr />
Expand Down

0 comments on commit e905d6e

Please sign in to comment.