定制 fubber/mini-cms 二次开发

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

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

fubber/mini-cms

Composer 安装命令:

composer require fubber/mini-cms

包简介

Template-first CMS aspect for fubber/mini — inline editing, media library, auto CRUD, and admin panel

README 文档

README

A template-first CMS aspect for fubber/mini. Adds inline editing, a media library, auto CRUD for database models, an admin panel, and an AI assistant — all layered on top of a plain Mini application without changing how the app itself works.

Requirements

Installation

composer require fubber/mini-cms

Quick start

Create the content directory structure your site needs:

_content/
  routes.php       # Page definitions
  models.php       # Data model registrations
  site.json        # Site name and description
_views/            # Your templates (override CMS defaults)
_static/           # Your CSS, images, etc.
uploads/           # Media uploads (created at runtime)

Define pages

In _content/routes.php, map URL paths to pages:

<?php
use MiniCms\Page;

return [
    '/'      => new Page('pages/home', title: 'Home'),
    '/about' => new Page('pages/about', title: 'About'),
];

Each page points to a view template in _views/. Views are plain PHP using Mini's template inheritance.

Inline-editable content

Use helper functions in your views to create regions the admin can edit:

<?= cms_text('home.json', 'Hero|Heading', 1, 'Welcome', 'h1') ?>
<?= cms_html('home.json', 'Hero|Body', 2, '<p>Default content here.</p>') ?>
<?= cms_image('home.json', 'Hero|Background', 3, '/default.jpg', 'img', 'Alt text', '16x9') ?>

Content is stored as JSON files in _content/. When the admin is logged in, these regions become editable in-place.

Data models

Register database models for auto CRUD in _content/models.php:

<?php
use MiniCms\Entity;
use App\Testimonial;

return [
    'testimonials' => (new Entity(Testimonial::class, icon: 'bi-chat-quote', pluralTitle: 'Testimonials'))
        ->withDefaultOrder('sort_order ASC'),
];

The admin panel automatically provides list, create, edit, and detail views. Customize any view by overriding it:

'testimonials' => (new Entity(Testimonial::class, icon: 'bi-chat-quote'))
    ->withIndexView('admin/data/testimonials/index.php')
    ->withEditView('admin/data/testimonials/edit.php'),

Entity relationships

When a model has a #[ForeignKey] attribute pointing to another registered entity, the CMS renders the field as a searchable picker in forms and as an inline reference in detail views.

#[ForeignKey(navigation: 'customer')]
public int $customer_id;

Admin panel

The admin panel lives under /admin/ and provides:

  • Page editor — inline editing with a component sidebar
  • Media library — upload, browse, crop, and organize images
  • Data management — auto-generated CRUD for registered models
  • Site settings — edit site name and metadata
  • AI assistant — chat with an AI agent that can read and edit your site files

Access the admin at /admin/ after setting CMS_PASSWORD in your .env file.

AI assistant

The CMS includes an AI assistant available as a drawer in the page editor and as a standalone page at /admin/ai/. It uses an adapter pattern — the default implementation (ClaudeCodeAgent) invokes the Claude Code CLI, but other backends can be swapped in by registering a different AgentInterface implementation.

The assistant has full context of your site structure and can read and modify files directly.

How aspects overlay

MiniCMS registers its routes, views, and static assets through Mini's path registry. Your application's files always take priority — if you define _views/partials/header.php, it overrides the CMS default. This lets you customize any part of the admin UI or public-facing templates without forking the package.

Building JS assets

If you need to modify the CMS JavaScript:

cd vendor/fubber/mini-cms
npm install
npm run build    # one-time build
npm run watch    # rebuild on changes

The bundle outputs to _static/admin/dist/cms.min.js. The built file is committed to the repo, so end users don't need Node.js.

Constraints

  • No external CDNs. All assets (Bootstrap, AdminLTE, fonts, icons) are served locally. This is a privacy requirement.
  • Filesystem content + git = versioning. All content lives in flat files, so your entire site is version-controlled by default.

License

MIT

fubber/mini-cms 适用场景与选型建议

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

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

围绕 fubber/mini-cms 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-09