定制 brammo/admin 二次开发

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

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

brammo/admin

最新稳定版本:1.1.0

Composer 安装命令:

composer require brammo/admin

包简介

Admin dashboard plugin for CakePHP

README 文档

README

Admin dashboard plugin for CakePHP 5 with Bootstrap UI integration.

Requirements

  • PHP 8.1 or higher
  • CakePHP 5.0 or higher
  • CakePHP Authentication plugin 3.0 or higher

Installation

Install via Composer:

composer require brammo/admin

Loading the Plugin

Load the plugin in your application's src/Application.php:

public function bootstrap(): void
{
    parent::bootstrap();
    
    $this->addPlugin('Brammo/Admin');
}

Features

View Helpers

The plugin provides several view helpers to simplify UI development:

  • ButtonHelper - Generate Bootstrap-styled buttons with icons

See docs/HELPERS.md for detailed documentation and examples.

Controllers

UserController

Provides user profile management:

  • profile() - View and edit user profile

Authentication

The plugin integrates with CakePHP Authentication and Brammo Auth plugin for user management and authentication.

Configuration

All configuration options are documented in docs/CONFIGURATION.md, including:

  • Internationalization
  • Brand customization
  • Home link
  • Sidebar menu
  • Layout assets (CSS, JavaScript, fonts)

Development

Running Tests

# Run all tests
composer test

# Run with verbose output
vendor/bin/phpunit --testdox

Static Analysis

The project uses both PHPStan and Psalm for static code analysis:

# Run PHPStan (level 8)
composer stan

# Run Psalm (level 1)
composer psalm

# Run all checks (tests + static analysis)
composer check

See docs/PHPSTAN.md and docs/PSALM.md for detailed documentation.

Code Quality

  • PHPStan Level: 8 (strictest)
  • Psalm Level: 1 (strictest)
  • Test Coverage: 45 tests, 120 assertions
  • PHP Version: 8.1+

Directory Structure

brammo/admin/
├── config/              # Plugin configuration
├── docs/                # Documentation
├── resources/           # Resources (translations, etc.)
│   └── locales/         # Translation files
├── src/                 # Source code
│   ├── Controller/      # Controllers
│   ├── Model/           # Models (Entity, Table)
│   ├── View/            # View classes and helpers
│   │   └── Helper/      # View helpers
│   └── Plugin.php       # Plugin bootstrap
├── templates/           # Templates
│   ├── element/         # Template elements
│   ├── layout/          # Layouts
│   └── User/            # User views
├── tests/               # Test suite
│   ├── Fixture/         # Test fixtures
│   └── TestCase/        # Test cases
└── webroot/             # Public assets
    ├── css/             # Stylesheets
    └── js/              # JavaScript files

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests and static analysis (composer check)
  5. Commit your changes (git commit -am 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Create a Pull Request

Code Standards

  • Follow PSR-12 coding standards
  • Write tests for new features
  • Ensure all tests pass
  • Maintain PHPStan level 8 and Psalm level 1 compliance
  • Add type hints to all methods

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Roman Sidorkin

Related Projects

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-25