1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-17 18:36:39 +02:00

Update theme simple according to the php template syntax guidelines

This commit is contained in:
Awilum
2018-12-14 03:28:11 +03:00
parent 8b4a9003cb
commit 604085e8b2
4 changed files with 20 additions and 16 deletions

View File

@@ -3,26 +3,28 @@
use Flextype\Component\{Event\Event, Http\Http, Registry\Registry, Assets\Assets, Text\Text, Html\Html};
?>
<!doctype html>
<html lang="<?php echo Registry::get('settings.locale'); ?>">
<html lang="<?= Registry::get('settings.locale'); ?>">
<head>
<meta charset="<?php echo Text::lowercase(Registry::get('settings.charset')); ?>">
<meta charset="<?= Text::lowercase(Registry::get('settings.charset')); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="<?php echo (isset($page['description']) ? Html::toText($page['description']) : Html::toText(Registry::get('settings.description'))); ?>">
<meta name="keywords" content="<?php echo (isset($page['keywords']) ? $page['keywords'] : Registry::get('settings.keywords')); ?>">
<meta name="robots" content="<?php echo (isset($page['robots']) ? $page['robots'] : Registry::get('settings.robots')); ?>">
<meta name="generator" content="Powered by Flextype <?php echo Flextype::VERSION; ?>" />
<meta name="description" content="<?= (isset($page['description']) ? Html::toText($page['description']) : Html::toText(Registry::get('settings.description'))); ?>">
<meta name="keywords" content="<?= (isset($page['keywords']) ? $page['keywords'] : Registry::get('settings.keywords')); ?>">
<meta name="robots" content="<?= (isset($page['robots']) ? $page['robots'] : Registry::get('settings.robots')); ?>">
<meta name="generator" content="Powered by Flextype <?= Flextype::VERSION; ?>" />
<?php Event::dispatch('onThemeMeta'); ?>
<title><?php echo Html::toText($page['title']); ?> | <?php echo Html::toText(Registry::get('settings.title')); ?></title>
<title><?= Html::toText($page['title']); ?> | <?= Html::toText(Registry::get('settings.title')); ?></title>
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700' rel='stylesheet' type='text/css'>
<?php Assets::add('css', Http::getBaseUrl() . '/site/themes/' . Registry::get('settings.theme') . '/assets/dist/css/bootstrap.min.css', 'site', 1); ?>
<?php Assets::add('css', Http::getBaseUrl() . '/site/themes/' . Registry::get('settings.theme') . '/assets/dist/css/simple.min.css', 'site', 2); ?>
<?php foreach (Assets::get('css', 'site') as $assets_by_priorities) { foreach ($assets_by_priorities as $assets) { ?>
<link href="<?php echo $assets['asset']; ?>" rel="stylesheet">
<?php } } ?>
<?php foreach(Assets::get('css', 'site') as $assets_by_priorities): ?>
<?php foreach($assets_by_priorities as $assets): ?>
<link href="<?= $assets['asset']; ?>" rel="stylesheet">
<?php endforeach ?>
<?php endforeach ?>
<?php Event::dispatch('onThemeHeader'); ?>
</head>

View File

@@ -4,14 +4,14 @@
?>
<nav class="navbar navbar-expand-lg navbar-light bg-white border-bottom box-shadow">
<div class="container">
<a class="navbar-brand" href="<?php echo Http::getBaseUrl(); ?>"><?php echo Registry::get('settings.title'); ?></a>
<a class="navbar-brand" href="<?= Http::getBaseUrl(); ?>"><?= Registry::get('settings.title'); ?></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-end" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link <?php if (Http::getUriSegment(0) == 'home' || Http::getUriSegment(0) == '') echo 'active'; ?>" href="<?php echo Http::getBaseUrl(); ?>">Home</a>
<a class="nav-link <?php if(Http::getUriSegment(0) == 'home' || Http::getUriSegment(0) == ''): ?>active<?php endif ?>" href="<?= Http::getBaseUrl(); ?>">Home</a>
</li>
</ul>
</div>

View File

@@ -3,7 +3,9 @@
use Flextype\Component\{Event\Event, Http\Http, Registry\Registry, Assets\Assets};
?>
<?php Assets::add('js', Http::getBaseUrl() . '/site/themes/' . Registry::get('settings.theme') . '/assets/dist/js/simple.min.js', 'site', 1); ?>
<?php foreach (Assets::get('js', 'site') as $assets_by_priorities) { foreach ($assets_by_priorities as $assets) { ?>
<script src="<?php echo $assets['asset']; ?>"></script>
<?php } } ?>
<?php foreach(Assets::get('js', 'site') as $assets_by_priorities): ?>
<?php foreach($assets_by_priorities as $assets): ?>
<script src="<?= $assets['asset']; ?>"></script>
<?php endforeach ?>
<?php endforeach ?>
<?php Event::dispatch('onThemeFooter'); ?>

View File

@@ -1,4 +1,4 @@
<?php namespace Flextype; ?>
<?php Themes::view('partials/head')->display(); ?>
<?php echo $page['content']; ?>
<?= $page['content']; ?>
<?php Themes::view('partials/footer')->display(); ?>