update conduit and documentation on master
This commit is contained in:
parent
3666741755
commit
7d7f0166cf
11 changed files with 172 additions and 9 deletions
32
application/include/actions/MenudocsAction.php
Normal file
32
application/include/actions/MenudocsAction.php
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use MVC\Classe\Implement\Action;
|
||||
use MVC\Classe\Response;
|
||||
|
||||
class MenudocsAction extends Action
|
||||
{
|
||||
public function default($data)
|
||||
{
|
||||
|
||||
|
||||
$files = array();
|
||||
|
||||
if ($handle = opendir(DATA_PATH . '/docs')) {
|
||||
|
||||
while (false !== ($entry = readdir($handle))) {
|
||||
|
||||
if ($entry != "." && $entry != "..") {
|
||||
|
||||
$files[] = $entry;
|
||||
}
|
||||
}
|
||||
|
||||
closedir($handle);
|
||||
}
|
||||
|
||||
asort($files);
|
||||
|
||||
return $this->render('menu-docs', array('files' => $files));
|
||||
}
|
||||
|
||||
}
|
||||
51
application/include/conduits/DocConduit.php
Normal file
51
application/include/conduits/DocConduit.php
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
|
||||
use Michelf\MarkdownExtra;
|
||||
use MVC\Classe\Implement\Conduit;
|
||||
|
||||
class DocConduit extends Conduit
|
||||
{
|
||||
// Route('/docs')
|
||||
public function index()
|
||||
{
|
||||
|
||||
$files = array();
|
||||
|
||||
if ($handle = opendir(DATA_PATH . '/docs')) {
|
||||
|
||||
while (false !== ($entry = readdir($handle))) {
|
||||
|
||||
if ($entry != "." && $entry != "..") {
|
||||
|
||||
$files[] = $entry;
|
||||
}
|
||||
}
|
||||
|
||||
closedir($handle);
|
||||
}
|
||||
|
||||
asort($files);
|
||||
|
||||
$this->templateData['page_title'] = 'Foo';
|
||||
$this->templateData['description'] = 'DocConduit';
|
||||
$this->templateData['files'] = $files;
|
||||
|
||||
return $this->render('docs', $this->templateData);
|
||||
}
|
||||
|
||||
// Route('/docs/file/{file}')
|
||||
public function readfile()
|
||||
{
|
||||
|
||||
$markdown = file_get_contents(DATA_PATH . '/docs/' . $this->file);
|
||||
|
||||
$my_html = MarkdownExtra::defaultTransform($markdown);
|
||||
|
||||
$this->templateData['page_title'] = 'Foo';
|
||||
$this->templateData['description'] = 'DocConduit';
|
||||
$this->templateData['data'] = $my_html;
|
||||
|
||||
return $this->render('docs', $this->templateData);
|
||||
|
||||
}
|
||||
}
|
||||
7
application/include/controlleurs/beers.php
Normal file
7
application/include/controlleurs/beers.php
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
|
||||
use MVC\Classe\Logger;
|
||||
|
||||
$templateData = array("templating_a" => 'blade', "templating_b" => 'twig', "templating_c" => 'edge');
|
||||
Logger::addLog('ok', 'Hello world');
|
||||
5
application/include/modeles/beers.model
Normal file
5
application/include/modeles/beers.model
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
name : beers
|
||||
page_title : module_title
|
||||
description : module_description
|
||||
params : module_params
|
||||
|
||||
|
|
@ -10,6 +10,8 @@
|
|||
<ul class="top-menu">
|
||||
<li @if($name == 'policy') class="actual" @endif ><a href="{{ \MVC\Classe\Url::link_rewrite( false, 'Policy', []) }}">Policy</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 == 'docs') class="actual" @endif ><a href="{{ \MVC\Classe\Url::link_rewrite( false, 'docs', []) }}">Documentation</a></li>
|
||||
<li @if($name == 'beers') class="actual" @endif ><a href="{{ \MVC\Classe\Url::link_rewrite( false, 'beers', []) }}">Support</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -37,7 +39,7 @@
|
|||
<div class="container">
|
||||
<nav>
|
||||
<ul>
|
||||
<li @if($name == 'search') class="actual" @endif ><a href="{{ \MVC\Classe\Url::link_rewrite( false, 'Index', []) }}">Index</a></li>
|
||||
<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>
|
||||
</ul>
|
||||
</nav>
|
||||
|
|
|
|||
38
application/include/vues/view/beers.blade.php
Normal file
38
application/include/vues/view/beers.blade.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
@extends('body')
|
||||
|
||||
@section('sidebar')
|
||||
@parent
|
||||
|
||||
<p>This is appended to the master sidebar.</p>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<h2 class="section-title" id="donate">Buy me some beers</h2>
|
||||
|
||||
<div class="donate-container">
|
||||
<div class="donate-description">
|
||||
<p>
|
||||
SAND FrameWork is an CC Universal-licensed 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 class="donate-footer">
|
||||
<a href="https://www.patreon.com/" class="beer-button button-ghost">Be a sponsor on Patreon</a>
|
||||
<a href="https://www.paypal.me/" class="beer-button button-secondary">Donate via PayPal</a>
|
||||
</div>
|
||||
|
||||
<img src="assets/img/beer.svg" alt="" class="donate-beer">
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
19
application/include/vues/view/docs.blade.php
Normal file
19
application/include/vues/view/docs.blade.php
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
@extends('body')
|
||||
|
||||
@section('sidebar')
|
||||
@parent
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
@if (isset($files))
|
||||
|
||||
<h1>Sommaire:</h1>
|
||||
|
||||
@foreach( $files as $file)
|
||||
<a href="{{ \MVC\Classe\Url::link_rewrite( false, 'docs', ['file'=>$file]) }}">{{ $file }}</a> <br/>
|
||||
@endforeach
|
||||
@endif
|
||||
@if (isset($data))
|
||||
{{$data}}
|
||||
@endif
|
||||
@endsection
|
||||
Loading…
Add table
Add a link
Reference in a new issue