sergiors/lullaby

Silex like Symfony 的配置

3.0.0 2016-12-01 18:30 UTC

This package is not auto-updated.

Last update: 2024-09-14 18:42:03 UTC


README

Lullaby 是在 Silex\Application 上的一层,它提供了更好的项目组织方式,类似于 Symfony 框架。

安装

composer require sergiors/lullaby "dev-master"

如何使用

例如这样

namespace Acme\Acme\Apps\Fluffy;

use Sergiors\Lullaby\Application\Application;

class Fluffy extends Application
{
}
namespace Acme\Acme;

use Sergiors\Lullaby\Kernel;

class AppKernel extends Kernel
{
    public function registerApps()
    {
        return [
            new Fluffy()
        ];
    }
    
    public function registerProviders()
    {
        return [];
    }
}

在你的索引文件中

$env = 'dev';
$debug = false;
$rootDir = __DIR__;

$app = new Acme\Acme\AppKernel($env, $debug, $rootDir);
$app->run();

许可证

MIT