carlbennett/php-mvc 问题修复 & 功能扩展

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

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

carlbennett/php-mvc

Composer 安装命令:

composer require carlbennett/php-mvc

包简介

A PHP micro-framework for use as a frontend and/or backend

README 文档

README

Build Status

php-mvc is a PHP standard library used with @carlbennett's projects. The aspirations of this library are for a project website to include it as middleware.

Installation

This library is available via composer from packagist.

composer require carlbennett/php-mvc
composer install

Usage

The following is an example of including this library in your project. This assumes you have already installed the library via composer.

<?php

namespace MySuperAwesomeProject;

use \CarlBennett\MVC\Libraries\GlobalErrorHandler;
use \CarlBennett\MVC\Libraries\Router;
use \CarlBennett\MVC\Libraries\Template;
use \RuntimeException;

// Can be used to route requests.

$router = new Router(
    "\\MySuperAwesomeProject\\Controllers\\",
    "\\MySuperAwesomeProject\\Views\\"
);
$router->addRoute( // URLs: /home, /home.htm, /home.html
    // pattern, model, view
    '#^/home(?:\.html?)?$#', 'Home', 'HomeHtml'
);
$router->route();
$router->send();

// Custom template engine powered by pure PHP, utilizes include() and output buffers.

$context = null; // empty context, used to pass state to template
(new Template($context, 'HelloWorld'))->render(); // prints ./src/Templates/HelloWorld.phtml to the client.

// A dynamic error handler. Prints JSON if display_errors is ON, a friendly html page if OFF.

GlobalErrorHandler::createOverrides();
throw new RuntimeException('test');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: AGPL-3.0
  • 更新时间: 2016-08-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固