GithubHelp home page GithubHelp logo

dariob / cakephp-utils Goto Github PK

View Code? Open in Web Editor NEW

This project forked from qoboltd/cakephp-utils

0.0 1.0 0.0 6.6 MB

:cake: CakePHP utilities

License: MIT License

PHP 18.55% CSS 17.29% JavaScript 58.27% HTML 5.79% CoffeeScript 0.09%

cakephp-utils's Introduction

CakePHP3.x Qobo Utils Plugin

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

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

This plugin is developed by Qobo for Qobrix. It can be used as standalone CakePHP plugin, or as part of the project-template-cakephp installation.

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.