zb-framework/core 问题修复 & 功能扩展

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

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

zb-framework/core

最新稳定版本:0.9.3.3

Composer 安装命令:

composer require zb-framework/core

包简介

A minimalistic php MVC framework core.

README 文档

README

ZBF-Core is a minimalistic PHP MVC framework designed as a Composer package. It provides a simple and lightweight structure for building web applications.

Usage

Once installed, you can use ZBF-Core to create and run your application.

Basic Example

Create an entry point (e.g., public/index.php) and initialize the framework:

<?php

// Load Composer's autoloader
require_once __DIR__ . '/../../vendor/autoload.php';

use ZbFramework\Core\App;

$app = new App(
    __DIR__ . '/',       // Webroot/public directory
    __DIR__ . '/../App/' // App directory
);

$app->registerRoute(
    'GET',      // HTTP method (use "ALL" or "*" for all methods)
    '/',        // Path (can contain URL parameters like /article/{article_id})
    Admin\App\Controllers\DashboardController::class,  // Controller class
    'index'     // Action method
);

$app->run();

Routing

You can register routes using $app->registerRoute(). It takes the following parameters:

  • HTTP Method: e.g., GET, POST, PUT, DELETE, ALL.
  • Path: The route URL, which can contain parameters (e.g., /user/{id}).
  • Controller Class: The fully qualified name of the controller handling the request.
  • Action Method: The method within the controller that will be executed.

Directory Structure

project-root/
│── App/
│   ├── Controllers/
│   │   ├── DashboardController.php
│   ├── Models/
│   ├── Templates/
│   │   ├── Layouts/
│   │   ├── Elements/
│   │   ├── Dashboard/
│   │   │   ├── index.php
│── public/
│   ├── index.php
│── vendor/
│── composer.json

Contributing

Feel free to contribute by submitting pull requests or reporting issues.

License

This project is licensed under the GPL-3.0 License.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0-only
  • 更新时间: 2025-09-20