forked from LastCallMedia/Mannequin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.mannequin.php
60 lines (53 loc) · 1.69 KB
/
.mannequin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
/*
* This file is part of Mannequin.
*
* (c) 2017 Last Call Media, Rob Bayliss <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
/**
* Note: This is a very advanced .mannequin.php file.
*
* For simpler examples, see:
*
* HTML: src/Html/demo/.mannequin.php
* Twig: src/Twig/demo/.mannequin.php
* Drupal: https://github.com/LastCallMedia/Drupal-Scaffold/blob/master/.mannequin.php
*/
use LastCall\Mannequin\Core\MannequinConfig;
use LastCall\Mannequin\Core\Ui\LocalUi;
use LastCall\Mannequin\Html\HtmlExtension;
use LastCall\Mannequin\Twig\TwigExtension;
use Symfony\Component\Finder\Finder;
$htmlFinder = Finder::create()
->files()
->name('*.html')
->in(__DIR__.'/src/Html/demo/html');
$twigFinder = Finder::create()
->files()
->name('*.twig')
->in(__DIR__.'/src/Twig/demo/templates');
$twig = new TwigExtension([
'finder' => $twigFinder,
'twig_root' => __DIR__.'/src/Twig/demo/templates',
'twig_options' => [
'auto_reload' => true,
],
]);
$html = new HtmlExtension([
'files' => $htmlFinder,
'root' => __DIR__.'/src/Html/demo/html',
]);
$config = MannequinConfig::create([
// Note: This setting should not be needed in your Mannequin config.
// it is only necessary here because we need to use the bleeding-edge
// version of the UI.
'ui' => new LocalUi(__DIR__.'/ui'),
])
->setGlobalJs(['https://cdnjs.cloudflare.com/ajax/libs/foundation/6.4.1/js/foundation.min.js'])
->setGlobalCss(['https://cdnjs.cloudflare.com/ajax/libs/foundation/6.4.1/css/foundation.min.css'])
->addExtension($html)
->addExtension($twig);
return $config;