Git Product home page Git Product logo

cakephp-niceadminbakescripts's Introduction

Nice Admin Bake Theme

A custom theme using Twitter Bootstrap to bake admin templates in CakePHP 3, using the CakePHP Bake plugin.

Requirements

  • CakePHP 3
  • PHP 5.4.16+

What is it?

This is a theme for the CakePHP/Bake plugin which will customise the code which is generated. I've made it because I don't like the default bake theme, or the fact that it outputs the actions sidebar.

Plus I tend to use Twitter Bootstrap to make my admin areas so this theme will leverage that front-end framework.

Installation

You should install this plugin into your CakePHP application using composer.

The recommended way to install composer packages is using,

composer require 'davidyell/nice-admin-bake-scripts:3.0.x-dev'

Setup

In your src/config/bootstrap.php you'll need to load the plugin with Plugin::load('NiceAdminBakeTheme');

In your admin layout, you'll need to include the theme and javascript.

<?= $this->Html->css([
    '//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css',
    '//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css'
]) ?>


<?= $this->Html->script([
    '//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js',
    '//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js'
]);?>

Optional extras

If you want to use Twitter Bootstrap for all your forms be sure to enable friendsofcake/bootstrap-UI in your application and loading the helpers in your src/View/AppView.php. Find out more about installing bootstrap-ui in their readme.

This can be easily coupled with the friendsofcake/crud plugin to pretty much make an entire basic admin in around 5 minutes!

A basic stylesheet is included to fix some minor things. You can add it to your layout using $this->Html->style('NiceAdminBakeTheme.nice-admin'). However it's much better to symlink the stylesheet into your own webroot/css and include it from there.

Baking

The theme should be available when you are baking. You can check this by just running a bake command with -h and checking the available themes listed in the --theme option help. If you don't see it make sure you've loaded the plugin.

Controllers

bin/cake bake controller --theme=NiceAdminBakeTheme Examples

Templates

bin/cake bake template --theme=NiceAdminBakeTheme Examples

Prefixed templates

bin/cake bake template --theme=NiceAdminBakeTheme --prefix=Admin Examples

Changes to standard bake

  • Removed the _serialize from the controllers
  • Removed the actions sidebar from all templates
  • Formatted tables with Bootstrap
  • Added a 'New' button to the top of tables
  • Add basic filter form to index templates
  • Tidied up the pagination
  • Made the Actions column links into buttons
  • Added handling for date, datetime and time using the Time helper
  • Added handling for boolean data using Bootstrap icons
  • Updated the View template to use Bootstrap panels
  • Spaced out the Table definition functions
  • Added classes to the columns in index templates

License

A custom cakephp/bake theme for generating customised cakephp code and templates.

Copyright (C) 2015 David Yell

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

cakephp-niceadminbakescripts's People

Contributors

davidyell avatar

Watchers

James Cloos avatar Francisco Velazquez avatar

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.