定制 droidevs/php-mvc-core 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

droidevs/php-mvc-core

最新稳定版本:1.0

Composer 安装命令:

composer require droidevs/php-mvc-core

包简介

README 文档

README

A lightweight PHP MVC core / micro-framework for learning and building custom web apps.

Table of Contents

Features

  • Simple routing (HTTP GET/POST)
  • Controllers, Views, Models
  • Request / Response abstraction
  • Session & flash messaging
  • Middleware support
  • Basic form validation & exception handling

Architecture / Concepts

Follows MVC pattern:

  • Model handles data and business logic
  • View renders presentation
  • Controller processes requests, interacts with models, returns responses
  • Router maps URL paths to controller actions
  • Middleware allows pre-/post-processing

Installation

git clone https://github.com/thecodeholic/tc-php-mvc-core.git
cd tc-php-mvc-core
composer install

Point your server’s document root to public (or route all requests to index.php). Use:

php -S localhost:8000 -t public

Usage

  1. Define routes
  2. Create controller classes extending Controller
  3. Create view templates in views/
  4. Create models extending Model
  5. Visit endpoints in browser

Directory Structure

/db
/exception
/form
/middlewares
/public
/views
/controllers
/models
Application.php
Controller.php
Model.php
Request.php
Response.php
Router.php
Session.php
View.php
composer.json
README.md

Configuration

Configure:

  • Database
  • Base URL / routing
  • Error handling
  • Middleware registration
  • Autoloading

Extending & Customization

You can build on the core by adding:

  • ORM enhancements
  • Dependency injection / service container
  • Advanced routing features
  • More middleware (auth, CSRF, caching)
  • Error & exception handling

Contributing

Contributions are welcome! Please open issues or PRs. Follow code style, document changes, and test where possible.

License

MIT License — see LICENSE

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2025-10-12