Exemple #1
0
 public function testInitRoute()
 {
     $root = \org\bovigo\vfs\vfsStream::setup('root');
     \org\bovigo\vfs\vfsStream::newFile('Routes.php')->at($root)->setContent('
     <?php
             return [
                 [
                     [\'POST\', \'GET\', \'PUT\', \'DELETE\'],
                     \'/[{table}[/{key}]]\',
                     [new \\Propeller\\Controllers\\FrontController(
                         new \\Propeller\\Models\\PersistenceModel(),
                         new \\Propeller\\Models\\OrmModel(),
                         new \\Propeller\\Models\\TemplateModel(),
                         new \\Propeller\\Models\\UrlModel(),
                         new \\Propeller\\Controllers\\MainController(),
                         new \\Propeller\\Views\\MainView()
                     ), \'init\']
                 ]
             ];
         ');
     $bootstrap = new \Propeller\Misc\Bootstrap();
     $bootstrap->routesPath = $root->getChild('Routes.php')->url();
     $bootstrap->initRoute();
 }
Exemple #2
0
<?php

require __DIR__ . '/../vendor/autoload.php';
$frontController = new \Propeller\Misc\Bootstrap();
$frontController->init();