A custom theme using Twitter Bootstrap to bake admin templates in CakePHP 3,using the CakePHP Bake plugin.
Requirements
- CakePHP 3
- PHP 5.6+
What is it?
Creating an Admin Section with CakePHP. Will include all the admin functions, fire up the 'bake' script in the command line and go through the steps of creating a. Get free CakePHP CMS script, content management PHP software for download. Logicspice offers collection of free PHP scripts and software for free. CakePHP is an open-source web, rapid development framework that makes building web applications simpler, faster and require less code. It follows the model–view–controller (MVC).
This is a theme for the CakePHP/Bake plugin which will customise the code which isgenerated. 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 willleverage 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,
Setup
In your 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 if you're using Twitter Bootstrap. This snippet also includes jQuery, so if you've already loaded that, please remove that line.
Optional extras
Php Admin Panel Script
If you want to use Twitter Bootstrap for all your forms be sure to enable friendsofcake/bootstrap-UIin 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 makean entire basic admin in around 5 minutes!
A basic stylesheet is included to fix some minor things. You can symlink the stylesheet into your own webroot/css
and include it from there, using
Of if you want to create the link manually cd webroot/css && ln -s ../../vendor/davidyell/nice-admin-bake-scripts/webroot/css/nice-admin.css
.
Baking
The theme should be available when you are baking. You can check this by just running a bake command with -h
andchecking the available themes listed in the --theme
option help. If you don't see it make sure you've loaded the plugin.
Controllers
Templates
Prefixed templates
Example layout, elements and dashboard
A basic admin layout, dashboard and navigation elements are included in the plugin. Which you can symlink, extend, orcopy into your project as you see fit.
If you want to link to the styles. echo $this->Html->css(['nice-admin']);
Movie Script Download
However it's preferable to use a symlink.
Script Download For Roblox
Changes to standard bake
Admin Panel Script
- 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
- Lists are now ordered
- Index pagination is done with a query