定制 eugenec137/cakephp-utils 二次开发

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

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

eugenec137/cakephp-utils

最新稳定版本:v1.0.0

Composer 安装命令:

composer require eugenec137/cakephp-utils

包简介

CakePHP utilities

README 文档

README

codecov Build Status Latest Stable Version Total Downloads Latest Unstable Version License

A variety of utilities that are common and useful for several of our plugins and application.

Developed by Qobo, used in Qobrix.

Usage

Install the pugin with composer:

composer require qobo/cakephp-utils

Load the plugin:

bin/cake plugin load Qobo/Utils --bootstrap

Check that the plugin is loaded:

bin/cake plugin loaded

The above should output the list of loaded plugins, with Qobo/Utils being one of them.

Functionality

AdminLTE

One of the primary objectives of this plugin is to simplify the loading and configuration of the AdminLTE theme CakePHP plugin. Here is what you need to set it up.

Load the AdminLTE plugin:

bin/cake plugin load AdminLTE --routes --bootstrap

Load AdminLTE plugin configuration at the bottom of config/bootstrap.php:

Configure::load('admin_lte', 'default');

Here is an example configuration you can stick into config/admin_lte.php:

<?php
return [
    'Theme' => [
        'folder' => ROOT,
        'title' => 'My App',
        'logo' => [
            // This will be displayed when main menu is collapsed.
            // You can use an <img> tag in here or anything else you want.
            'mini' => 'A',
            // This will be displayed when main menu is expanded.
            // You can use an <img> tag in here or anything else you want.
            'large' => 'My App',
        ],
        'login' => [
            'show_remember' => true,
            'show_register' => false,
            'show_social' => false,
        ],
    ],
];

Load AdminLTE theme in beforeRender() method of src/Controller/AppController.php:

// At the top of the file, together with other use statements:
use Cake\Core\Configure;

public function beforeRender(Event $event)
{
    $this->viewBuilder()->theme('AdminLTE');
    $this->set('theme', Configure::read('Theme'));
    // $this->set('user', $this->Auth->user());
    $this->set('user', []);
}

Load AdminLTE Form Helper in initialize() method of src/View/AppView.php:

public function initialize()
{
    $this->loadHelper('Form', ['className' => 'AdminLTE.Form']);
}

For more information on initializing and configuring the AdminLTE theme, see plugin documentation

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-30