eugenec137 / cakephp-utils
CakePHP utilities
Installs: 8
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:JavaScript
Type:cakephp-plugin
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-11-05 15:57:13 UTC
README
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