simpletine/hmvc-shield 问题修复 & 功能扩展

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

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

simpletine/hmvc-shield

Composer 安装命令:

composer require simpletine/hmvc-shield

包简介

Features a modular HMVC (Hierarchical Model-View-Controller) architecture for CodeIgniter 4, integrated CodeIgniter 4 Shield and built with AdminLTE, providing a robust foundation for scalable web applications.

README 文档

README

Official Website YouTube Channel

Codeigniter 4 HMVC

This repository features a modular HMVC (Hierarchical Model-View-Controller) architecture for CodeIgniter 4, integrated with the official authentication system, CodeIgniter 4 Shield. It also includes a comprehensive Admin Dashboard built with AdminLTE, providing a robust foundation for scalable and secure web applications.

Installation Guide

Create a project

composer create-project simpletine/codeigniter4-starter ci4_hmvc --stability=dev

Copy env file and setup database environment

cp env .env

Run the app, using different port, add options --port=9000

php spark serve

Configuration

Install HMVC package

composer require simpletine/hmvc-shield

Setup Command Line

php spark simpletine:setup

Default Auth

email: super@admin.com
password: password

Create User

Use command line to create a new user

php spark shield:user create

Notice

If you are using old versions, after composer update, you need to update the index.php and spark file to root folder (Upgrading to v4.4.8)

composer update
cp vendor/codeigniter4/framework/public/index.php public/index.php
cp vendor/codeigniter4/framework/spark spark

Module Commands

Commands available and funcationality

General

Create a new module named Blogs

php spark module:create Blogs 

Clone a existing module of Blogs and renamed to Items

php spark module:copy Blogs Items 

Create a controller to module Blogs named Categories.php

php spark module:controller Blogs Categories 

Create a model to module Blogs named Categories.php

php spark module:model Blogs Categories 

Publisher

Publish require assets to public folder

php spark publish:assets 

Publish views with AdminLTE to COnfig/Auth.php

php spark publish:views 

Admin

Additional options for the commands

Create a new controller and view to Admin module with AdminLTE

php spark module:controller Admin Users --admin 

Modules Directory

App 
├── Modules      
│   └── Blogs
│       ├──  Config
│           └──  Routes.php
│       ├──  Controllers
│           └──  Blogs.php
│       ├──  Models
│           └──  Blogs.php
│       └──  Views
│           └──  index.php
└── ...  

Route Group

Add new subroutes to blogs named new with method name

$routes->get('new', 'Blogs::new');

Sample of routes group after new subroutes

$routes->group(
    'blogs', ['namespace' => '\Modules\Blogs\Controllers'], function ($routes) {
        $routes->get('/', 'Blogs::index');
        $routes->get('new', 'Blogs::new');
    }
);

PHPCS

Default instance of containing all rules applicable for the CodeIgniter organization

composer run fix

PSR4

At App/Config/Autoload.php, you can configure your custom namespace:

public $psr4 = [
    "Blogs" => APPPATH . "Modules/Blogs", // Example 
    // ...
];

simpletine/hmvc-shield 适用场景与选型建议

simpletine/hmvc-shield 是一款 基于 CSS 开发的 Composer 扩展包,目前已累计 703 次下载、GitHub Stars 达 16, 最近一次更新时间为 2024 年 07 月 27 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 simpletine/hmvc-shield 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 16
  • Watchers: 3
  • Forks: 4
  • 开发语言: CSS

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-07-27