secondtruth/wumbo 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

secondtruth/wumbo

Composer 安装命令:

composer require secondtruth/wumbo

包简介

A simple web application framework

README 文档

README

Go from Mini to Wumbo!

Wumbo is a framework for building simple web applications in PHP.

Installation

Install via Composer

Install Composer if you don't already have it present on your system.

To install the library, run the following command and you will get the latest version:

$ composer require secondtruth/wumbo:dev-main

Usage

Create a new file called public/index.php and add some code like this:

<?php
namespace Secondtruth\SampleWebsite;

use DI\Container;
use Secondtruth\Wumbo\Application;
use Secondtruth\Wumbo\View\Templating\TemplatingEngineInterface;
use Secondtruth\Wumbo\View\Templating\TwigEngine;
use Secondtruth\Wumbo\Loader\Routes\MultisiteRoutesLoader;

define('APP_ROOT', realpath(__DIR__ . '/..'));
define('CONFIG_DIR', APP_ROOT . '/config');

require APP_ROOT . '/vendor/autoload.php';

// Create a DI container to inject the dependencies you want to use.
// We use the PHP-DI container here, but you can use any other PSR-11 compatible container as well.
// In this example, we set Twig as our template engine.
$container = new Container();
$container->set(TemplatingEngineInterface::class, TwigEngine::create(APP_ROOT . '/resources/views', [
    'cache' => APP_ROOT . '/var/cache/twig',
]));

// Create and set up a routes loader and give it to the application.
$routesLoader = new MultisiteRoutesLoader(CONFIG_DIR);
$routesLoader->registerSite('example.com'); // Give the domain of your website

// Create a new Application instance and set routes loader and container.
$app = new Application($routesLoader, $container);
$app->setCachePath(APP_ROOT . '/var/cache');

$app->run();

Author, Credits and License

This project was created by Christian Neff (@secondtruth) and is licensed under the MIT license.

Thanks to all other Contributors!

统计信息

  • 总下载量: 15
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-09-07