定制 webdernargor/thungthao 二次开发

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

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

webdernargor/thungthao

Composer 安装命令:

composer create-project webdernargor/thungthao

包简介

PHP page layout components system clone form nuxt starter code

README 文档

README

Pages layouts components system by PHP starter code.

starter with layouts, pages (file-based routing), components, controllers, composables, API, and global hooks.

Features

  • Layouts: Define page shells in layouts/ and switch with $layout->setLayout('default').
  • File-based Routing: Files in pages/ map to URLs. Dynamic params via [param], folder index.php supported.
  • Components: Reusable UI from components/ included in layouts/pages.
  • Controllers: PSR-4 autoloaded under App\\Controllers\\.
  • Composables: Utilities in composables/ that return callable arrays.
  • API: JSON endpoints in api/ (directly accessible as /api/*.php).
  • Global: global.php runs on every request.
  • Styling: TailwindCSS + jQuery via CDN in layout.
  • Docs: Built-in documentation at /docs (navbar, sidebar, search).

Documentation

Requirements

  • PHP >= 7.0
  • Composer
  • Web server (Apache/Nginx) or PHP built-in server
  • For Apache, enable rewrite and use the provided .htaccess

Quick Start

# create a new project
composer create-project webdernargor/thungthao

# copy environment template
cp example.env .env   # Windows PowerShell: Copy-Item example.env .env

# start the dev server (uses serve.php)
composer web

Open the URL configured in .env (WEB_URL) or as printed by the dev server.

Configuration (.env)

Key variables consumed by config.php:

  • WEB_MODE (e.g. development)
  • WEB_URL (e.g. http://127.0.0.1:5000)
  • WEB_NAME
  • JWT_SECRET
  • DB_DRIVER (mysql | sqlite | none)
  • MySQL: MYSQL_HOST, MYSQL_DATABASE, MYSQL_USER, MYSQL_PASSWORD, MYSQL_PORT, MYSQL_CHARSET
  • SQLite: SQLITE_PATH

Directory Structure

.
├─ api/                # JSON endpoints
├─ components/         # UI components
├─ composables/        # Reusable utilities (return arrays of functions)
├─ controllers/        # App\\Controllers classes
├─ includes/           # Core (internal) — avoid editing
├─ layouts/            # Page shells
├─ pages/              # File-based routes
├─ public/             # Public assets (e.g., js/docs-search.js)
├─ config.php          # Loads .env and builds config array
├─ global.php          # Runs on every request
├─ index.php           # Entry point
└─ serve.php           # Dev server helper

Usage Examples

Set head in a page

<?php
$config = getConfig();
$setHead(<<<HTML
<title> Home - {$config['web']['name']}</title>
HTML);
?>

Switch layout for a page

<?php $layout->setLayout('default'); ?>

Include a component

<?php include __DIR__ . "/../components/navbar.php"; ?>

Use a composable

<?php
$dbUtil = composables('useDB');
$pdo = $dbUtil['connect']();
?>

Use a controller

<?php
use App\\Controllers\\Mycontroller;
$ctl = new Mycontroller();
?>

Create an API endpoint

<?php
// api/hello.php
require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/../includes/CoreFunction.php';
header('Content-Type: application/json; charset=utf-8');
echo json_encode(['status' => 'ok']);

Dynamic params in routes

<?php
// pages/blog/[id].php
$params = useParams();
echo $params['id'] ?? '';
?>

Global hooks

<?php
// global.php
// Place helpers or middleware-like checks here

Development Tips

  • Set WEB_MODE=development to enable helpful logs via show_error_log().
  • Avoid modifying includes/ unless you intend to change the framework internals.

License (Owner‑Managed)

  • The project owner @WEBDERNargor manages the license terms.
  • Current status: Free to use (personal or commercial) and modify within your projects. Attribution is appreciated.
  • Future changes: License terms may change at your discretion. New releases may adopt new terms; previously released versions remain governed by the terms under which they were published.
  • Provided “as is”, without warranty of any kind. Use at your own risk.

If you formalize terms later, add a dedicated LICENSE file and update this section.

Authors

webdernargor/thungthao 适用场景与选型建议

webdernargor/thungthao 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 10 月 22 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 webdernargor/thungthao 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 webdernargor/thungthao 我们能提供哪些服务?
定制开发 / 二次开发

基于 webdernargor/thungthao 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

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