SAND-framework/data/docs/04.b. Les vues Blade.md

257 lines
13 KiB
Markdown
Raw Normal View History

#Les vues Blade
Elles sont chargées dans cette ordre:
* application/include/vues/system
* application/include/vues/layout
* application/include/vues/view
ainsi la vue standard peut étendre de `application/include/vues/layout/body.blade.php`
```php
@extends('system')
@section('body')
<!-- Body Inner -->
<div class="body-inner">
<!-- Topbar -->
<div id="topbar" class="d-none d-xl-block d-lg-block topbar-transparent topbar-fullwidth dark"
style="background: rgba(0, 0, 0, 0.59);">
<div class="container">
<ul class="top-menu">
{{\MVC\Object\Environment::getTextEnvironment()}}
<li @if($name == 'docs_route' || $name == 'docs_name_route') class="actual" @endif ><a href="{{ \MVC\Classe\Url::link_rewrite( false, 'docs', []) }}">Documentation</a></li>
<li @if($name == 'depots') class="actual" @endif ><a href="{{ \MVC\Classe\Url::link_rewrite( false, 'gitlist/SAND-FrameWork', []) }}">Dépot</a></li>
<li @if($name == 'donate') class="actual" @endif ><a href="{{ \MVC\Classe\Url::link_rewrite( false, 'Donate', []) }}">Donate</a></li>
<li @if($name == 'cgu') class="actual" @endif ><a href="{{ \MVC\Classe\Url::link_rewrite( false, 'CGU', []) }}"> CGU Terms</a></li>
<li @if($name == 'policy') class="actual" @endif ><a href="{{ \MVC\Classe\Url::link_rewrite( false, 'Policy', []) }}">Policy</a></li>
<li @if($name == 'feedback') class="actual" @endif ><a href="{{ \MVC\Classe\Url::link_rewrite( false, 'Feedback', []) }}">Feedback</a></li>
</ul>
</div>
</div>
<!-- end: Topbar -->
<!-- Header -->
<header id="header" class="dark" data-transparent="true" data-fullwidth="true"
style="background: rgba(0, 0, 0, 0.59);">
<div class="header-inner">
<div class="container">
<!--Navigation Resposnive Trigger-->
<div id="mainMenu-trigger">
<a class="lines-button x"><span class="lines"></span></a>
</div>
<!--end: Navigation Resposnive Trigger-->
<!--Navigation-->
<div id="mainMenu">
<div class="container">
<!--Logo-->
<div id="logo">
<a href="#">
SAND Framework
</a>
</div>
<!--end: logo-->
<nav>
<ul>
<li @if($name == 'index') class="actual" @endif ><a href="{{ \MVC\Classe\Url::link_rewrite( false, 'Index', []) }}">Index</a></li>
<li @if($name == 'admin') class="actual" @endif ><a href="{{ \MVC\Classe\Url::link_rewrite( false, 'Admin', []) }}">Admin</a></li>
<li @if($name == 'symfony4_4') class="actual" @endif ><a href="{{ \MVC\Classe\Url::link_rewrite( false, 'Symfony4_4', []) }}"> Module Symfony 4.4</a></li>
<li @if($name == 'symfony5_1') class="actual" @endif ><a href="{{ \MVC\Classe\Url::link_rewrite( false, 'Symfony5_1', []) }}"> Module Symfony 5.1</a></li>
<li @if($name == 'symfony5_2') class="actual" @endif ><a href="{{ \MVC\Classe\Url::link_rewrite( false, 'Symfony5_2', []) }}"> Module Symfony 5.2</a></li>
<li @if($name == 'symfony5_3') class="actual" @endif ><a href="{{ \MVC\Classe\Url::link_rewrite( false, 'Symfony5_3', []) }}"> Module Symfony 5.3</a></li>
</ul>
</nav>
</div>
</div>
<!--end: Navigation-->
</div>
</div>
</header>
<!-- end: Header -->
<!-- Subbar -->
@if(isset($authentification) && $authentification == 'yes')
<div id="subbar" class="fullwidth">
<div class="container">
<span style="float:left;">Vous êtes connecté en tant que {{$_SESSION['user_login']}}</span>
<span style="float:right;"><a href="{{ \MVC\Classe\Url::link_rewrite( false, 'Logout', []) }}">Se Deconnecter</a></span>
</div>
</div>
@endif
<!-- end: Subbar -->
<!-- Breadcrumbs -->
@if (isset($ariane))
<div id="breadcrumbs" class="fullwidth">
<div class="container">
<nav aria-label="breadcrumb">
<ol class="breadcrumb-sand">
@foreach($ariane as $value)
@if($value == end($ariane))
<li class="breadcrumb-item active" aria-current="page">{{$value}}</li>
@else
<li class="breadcrumb-item"><a href="{{\MVC\Classe\Url::link_rewrite(false,$arianelink[array_search($value,$ariane)])}}">{{$value}}</a></li>
@endif
@endforeach
</ol>
</nav>
</div>
</div>
@endif
<!-- end: BreadCrumbs -->
<section id="page-content">
<div class="container">
<!--Alerts-->
@if(isset($_SESSION['alerts']))
@foreach($_SESSION['alerts'] as $alert)
<div class="alert alert-{{$alert['type']}} alert-dismissible fade show" role="alert">
<strong>{{$alert['title']}}</strong> {{$alert['message']}}.
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
@endforeach
@endif
<!--end: Alerts-->
@yield('content')
</div>
</section>
<!-- Footer -->
<footer id="footer">
<div class="footer-content">
<div class="container">
<div class="row">
<div class="col-lg-3">
<div class="widget">
<div class="widget-title"></div>
<p class="mb-5">
<img src="{{ \MVC\Classe\Url::asset_rewrite('assets/img/1007698-ffeb3b.svg') }}" width="150">
</p>
</div>
</div>
<div class="col-lg-9">
<p>
SAND FrameWork is an CC-licensed or MIT-licenced open source project and completely free to use.
</p>
<p>
However, the amount of effort needed to maintain and develop new features for the project is not
sustainable without proper financial backing.
You can support its ongoing development by being a backer or a sponsor on
<a href="https://www.patreon.com/">Patreon campaign</a>
(recurring, with perks for different tiers), and get your company logo here.
</p>
<p>
Also, you can make a <a href="https://www.paypal.me/">one time donation via PayPal</a>.
</p>
</div>
</div>
</div>
<div class="copyright-content">
<div class="container">
<div class="copyright-text text-center">&copy; 2020-2021 Built with SAND Framework - Responsive SAND Template.</div>
</div>
</div>
</div>
</footer>
<!-- end: Footer -->
</div>
<!-- end: Body Inner -->
@endsection
```
qui étends de `application/include/vues/system/system.blade.php`
```php
<!DOCTYPE html>
<html>
<head>
<title>{{$page_title}}</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="author" content="" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" lang="fr" content="{{$description}}"/>
<link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
@section('top-css')
<link rel="stylesheet" href="{{ \MVC\Classe\Url::asset_rewrite('assets/bootstrap-5.0.0-beta1-dist/css/bootstrap.min.css')}}">
<link rel="stylesheet" href="{{ \MVC\Classe\Url::asset_rewrite('assets/css/custom.css')}}">
@if(\MVC\Classe\Browser::get() == 'Internet Explorer')
<link rel="stylesheet" href="{{\MVC\Classe\Url::asset_rewrite('assets/html5-simple-date-input-polyfill-master/html5-simple-date-input-polyfill.css')}}">
<!--<link rel="stylesheet" href="{{\MVC\Classe\Url::asset_rewrite('assets/hyperform-0.12.0/css/hyperform.css')}}">-->
@endif
@show
</head>
<body>
@section('top-javascript')
@if(\MVC\Classe\Browser::get() == 'Internet Explorer')
<!-- Polyfill.io will load polyfills your browser needs -->
<script src="https://polyfill.io/v3/polyfill.min.js?features=default%2CNumber.parseInt%2CNumber.parseFloat%2CArray.prototype.find%2CArray.prototype.includes"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.12.1/polyfill.min.js" integrity="sha512-uzOpZ74myvXTYZ+mXUsPhDF+/iL/n32GDxdryI2SJronkEyKC8FBFRLiBQ7l7U/PTYebDbgTtbqTa6/vGtU23A==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"></script>
<script src="{{\MVC\Classe\Url::asset_rewrite('assets/html5-simple-date-input-polyfill-master/html5-simple-date-input-polyfill.js')}}"></script>
<script src="{{\MVC\Classe\Url::asset_rewrite('assets/hyperform-0.12.0/dist/hyperform.js')}}"></script>
<script>hyperform(window);</script>
@endif
@show
@yield('body')
@section('bottom-javascript')
<script src="{{ \MVC\Classe\Url::asset_rewrite('assets/bootstrap-5.0.0-beta1-dist/js/bootstrap.min.js')}}"></script>
<script src="{{ \MVC\Classe\Url::asset_rewrite('assets/js/custom.js')}}"></script>
@if(\MVC\Classe\Browser::get() !== 'Internet Explorer')
<script>
/*
SCRIPT JS permettant de ne valider qu'une seule fois un formulaire
ATTENTION tous les formulaires sont affecté
Lors d'une validation bootstrap personnalisé veuillez utilisé
la class do-resubmit sur le formulaire afin de permettre
l'activation supplémentaire du bouton.
*/
window.onload = function() {
let PreventAllforms = document.querySelectorAll("form");
Array.prototype.slice.call(PreventAllforms)
.forEach(function (PreventForm) {
PreventForm.onsubmit = submitted.bind(PreventForm);
});
}
function submitted(event) {
if (event.target.classList.contains('do-resubmit')) {
event.submitter.disabled = false;
}else{
event.submitter.disabled = true;
}
}
</script>
@endif
@show
</body>
</html>
```