eugenec137 / cakephp-utils
CakePHP 工具
v1.0.0
2023-07-04 09:44 UTC
Requires
- admad/cakephp-jwt-auth: ^2.0
- alt3/cakephp-swagger: ^1.0
- arvenil/ninja-mutex: ^0.6
- burzum/cakephp-file-storage: ^1.2
- burzum/cakephp-imagine-plugin: ^2.1
- cakedc/users: ^4.0
- cakephp/cakephp: ^3.10.5
- cakephp/migrations: ~1.0
- friendsofcake/crud: ^5.2
- fzaninotto/faker: ^1.0
- league/csv: ^8.1
- league/json-guard: ^0.5
- lorenzo/audit-stash: ^1.0
- maiconpinto/cakephp-adminlte-theme: ^1.0
- muffin/trash: ^1.1
- myclabs/php-enum: ^1.5
- piwik/ini: ^1.0
- pyrech/composer-changelogs: ^1.4
- rlanvin/php-rrule: ^1.6
Requires (Dev)
- cakephp/cakephp-codesniffer: ^3.0
- phpunit/phpunit: ^5.0
This package is not auto-updated.
Last update: 2024-09-24 15:20:00 UTC
README
提供多种通用且对多个插件和应用程序有用的工具。
使用方法
使用composer安装插件
composer require qobo/cakephp-utils
加载插件
bin/cake plugin load Qobo/Utils --bootstrap
检查插件是否已加载
bin/cake plugin loaded
上述操作应输出加载的插件列表,其中应包含Qobo/Utils
。
功能
AdminLTE
本插件的主要目标之一是简化AdminLTE主题CakePHP插件的加载和配置。以下是需要设置的内容。
加载AdminLTE插件
bin/cake plugin load AdminLTE --routes --bootstrap
在config/bootstrap.php
的底部加载AdminLTE插件配置
Configure::load('admin_lte', 'default');
以下是一个您可以将其粘贴到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, ], ], ];
在src/Controller/AppController.php
的beforeRender()
方法中加载AdminLTE主题
// 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', []); }
在src/View/AppView.php
的initialize()
方法中加载AdminLTE表单助手
public function initialize() { $this->loadHelper('Form', ['className' => 'AdminLTE.Form']); }
有关初始化和配置AdminLTE主题的更多信息,请参阅插件文档