<?php // Uncomment or remove // SlimBoilerplate\Layout\LayoutView::addJs('assets/js/demo.js'); // SlimBoilerplate\Layout\LayoutView::addCss('assets/css/demo.css'); SlimBoilerplate\Layout\LayoutView::setTitle('This is my title'); SlimBoilerplate\Layout\LayoutView::setDescription('This is my description'); SlimBoilerplate\Layout\LayoutView::setKeywords('This, is, my, keywords'); ?> <h2>Hello, DEMO 2</h2>
<?php SlimBoilerplate\Layout\LayoutView::addJs('assets/js/contact.js'); SlimBoilerplate\Layout\LayoutView::setTitle('Contact'); // SlimBoilerplate\Layout\LayoutView::setDescription('This is my description'); // SlimBoilerplate\Layout\LayoutView::setKeywords('This, is, my, keywords'); ?> <h2>Contact</h2> <?php if (!isset($success) && !isset($error)) { ?> <div class="gmap" id="maps"></div> <?php } ?> <form action="<?php echo url('contact'); ?> " method="post" class="contact" id="contact-form"> <?php if (isset($success) && $success) { ?> <div id="contact-validation-success" class="success">Votre message a été envoyé avec succès.</div> <?php } ?>
<?php SlimBoilerplate\Layout\LayoutView::setTitle('Error'); SlimBoilerplate\Layout\LayoutView::setDescription('Error page'); ?> <div> <h1>Error</h1> <?php if (isset($flash['error'])) { ?> <div class="error"><?php echo $flash['error']; ?> </div> <?php } ?> </div>
}); $app->configureMode('development', function () use($app) { $app->config(array('log.enable' => false, 'debug' => true)); }); //Use the layout class if not Ajax request if (!$app->request()->isAjax()) { $app->view(new SlimBoilerplate\Layout\LayoutView()); $app->notFound(function () use($app) { include "404.html"; }); } // ######################################## // ###### DEFAULT LAYOUT CONFIG ########### SlimBoilerplate\Layout\LayoutView::addCss('assets/css/vendor/normalize.min.css'); SlimBoilerplate\Layout\LayoutView::addCss('assets/css/style.css'); SlimBoilerplate\Layout\LayoutView::addJs('assets/js/vendor/modernizr-2.6.2-custom.min.js'); //SlimBoilerplate\Layout\LayoutView::setDefaultDescription('Slim PHP boilerplate'); // ######################################## // ############### ROUTES ################# // REST API // Very simple Rest server for the "account" sql table $restAccounts = new \SlimBoilerplate\Rest\RestServer('account'); $restAccounts->createRoutes($app); // HTML $app->get('/', function () use($app) { $app->render('home.php'); })->name('home'); $app->get('/error', function () use($app) { $app->render('error.php'); })->name('error'); $app->get('/pay', function () use($app) {