Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# BootstrapCake Shell Template
**Warning:** Only for CakePHP 4.x

BootstrapCake is a shell template for rapidly developing beautiful Bootstrap themed CakePHP applications through the CakePHP console. The default template uses the ugly CakePHP styling but this template makes your app look beautiful by default.
# Bootstrap4Cake Shell Template

Bootstrap4Cake is a shell template for rapidly developing beautiful Bootstrap 4 themed CakePHP applications through the CakePHP 2.x console. The default template uses the ugly CakePHP styling but this template makes your app look beautiful by default.

![2019-01-20-185335_2720x986_scrot](https://user-images.githubusercontent.com/9076747/51443177-224beb00-1ce5-11e9-8839-a6c6d3b3a0a6.png)

## Requirements

* [CakePHP](http://cakephp.org/) >= 2.3
* [Bootstrap](http://getbootstrap.com/) >= 3.0
* [Bootstrap](http://getbootstrap.com/) >= 4.0

## Installation

Expand All @@ -23,4 +27,4 @@ class AppController extends Controller {
* Start baking! If you've never used the console, here's a great tutorial: [http://book.cakephp.org/2.0/en/console-and-shells/code-generation-with-bake.html](http://book.cakephp.org/2.0/en/console-and-shells/code-generation-with-bake.html)
* Make sure you select the bootstrap template when prompted

For more information and screenshots, please visit [http://www.ekoim.com/blog/bootstrap-cakephp-bootstrapcake/](http://www.ekoim.com/blog/bootstrap-cakephp-bootstrapcake/)
For more information and screenshots, please visit [http://www.ekoim.com/blog/bootstrap-cakephp-bootstrapcake/](http://www.ekoim.com/blog/bootstrap-cakephp-bootstrapcake/) (Bootstrap3 Version)
24 changes: 12 additions & 12 deletions app/Console/Templates/bootstrap/views/form.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<div class="<?php echo $pluralVar; ?> form">

<div class="row">
<div class="col-md-12">
<div class="col-lg-12">
<div class="page-header">
<h1><?php printf("<?php echo __('%s %s'); ?>", Inflector::humanize($action), $singularHumanName); ?></h1>
</div>
Expand All @@ -30,24 +30,24 @@


<div class="row">
<div class="col-md-3">
<div class="col-lg-3">
<div class="actions">
<div class="panel panel-default">
<div class="panel-heading"><?php echo "<?php echo __('Actions'); ?>";?></div>
<div class="panel-body">
<ul class="nav nav-pills nav-stacked">
<div class="card">
<div class="card-header"><?php echo "<?php echo __('Actions'); ?>";?></div>
<div class="card-body">
<ul class="nav nav-pills flex-column">

<?php if (strpos($action, 'add') === false): ?>
<li><?php echo "<?php echo \$this->Form->postLink('<span class=\"glyphicon glyphicon-remove\"></span>&nbsp;&nbsp;'.__('Delete'), array('action' => 'delete', \$this->Form->value('{$modelClass}.{$primaryKey}')), array('escape' => false), __('Are you sure you want to delete # %s?', \$this->Form->value('{$modelClass}.{$primaryKey}'))); ?>"; ?></li>
<li><?php echo "<?php echo \$this->Form->postLink('<span class=\"fa fa-remove\"></span>&nbsp;&nbsp;'.__('Delete'), array('action' => 'delete', \$this->Form->value('{$modelClass}.{$primaryKey}')), array('escape' => false), __('Are you sure you want to delete # %s?', \$this->Form->value('{$modelClass}.{$primaryKey}'))); ?>"; ?></li>
<?php endif; ?>
<li><?php echo "<?php echo \$this->Html->link('<span class=\"glyphicon glyphicon-list\"></span>&nbsp;&nbsp;'.__('List " . $pluralHumanName . "'), array('action' => 'index'), array('escape' => false)); ?>"; ?></li>
<li><?php echo "<?php echo \$this->Html->link('<span class=\"fa fa-list\"></span>&nbsp;&nbsp;'.__('List " . $pluralHumanName . "'), array('action' => 'index'), array('escape' => false)); ?>"; ?></li>
<?php
$done = array();
foreach ($associations as $type => $data) {
foreach ($data as $alias => $details) {
if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) {
echo "\t\t<li><?php echo \$this->Html->link('<span class=\"glyphicon glyphicon-list\"></span>&nbsp;&nbsp;'.__('List " . Inflector::humanize($details['controller']) . "'), array('controller' => '{$details['controller']}', 'action' => 'index'), array('escape' => false)); ?> </li>\n";
echo "\t\t<li><?php echo \$this->Html->link('<span class=\"glyphicon glyphicon-plus\"></span>&nbsp;&nbsp;'.__('New " . Inflector::humanize(Inflector::underscore($alias)) . "'), array('controller' => '{$details['controller']}', 'action' => 'add'), array('escape' => false)); ?> </li>\n";
echo "\t\t<li><?php echo \$this->Html->link('<span class=\"fa fa-list\"></span>&nbsp;&nbsp;'.__('List " . Inflector::humanize($details['controller']) . "'), array('controller' => '{$details['controller']}', 'action' => 'index'), array('escape' => false)); ?> </li>\n";
echo "\t\t<li><?php echo \$this->Html->link('<span class=\"fa fa-plus\"></span>&nbsp;&nbsp;'.__('New " . Inflector::humanize(Inflector::underscore($alias)) . "'), array('controller' => '{$details['controller']}', 'action' => 'add'), array('escape' => false)); ?> </li>\n";
$done[] = $details['controller'];
}
}
Expand All @@ -58,7 +58,7 @@
</div>
</div>
</div><!-- end col md 3 -->
<div class="col-md-9">
<div class="col-lg-9">
<?php echo "\t\t\t<?php echo \$this->Form->create('{$modelClass}', array('role' => 'form')); ?>\n\n"; ?>
<?php
foreach ($fields as $field) {
Expand All @@ -80,7 +80,7 @@
?>
<?php
echo "\t\t\t\t<div class=\"form-group\">\n";
echo "\t\t\t\t\t<?php echo \$this->Form->submit(__('Submit'), array('class' => 'btn btn-default')); ?>\n";
echo "\t\t\t\t\t<?php echo \$this->Form->submit(__('Submit'), array('class' => 'btn btn-primary')); ?>\n";
echo "\t\t\t\t</div>\n\n";

echo "\t\t\t<?php echo \$this->Form->end() ?>\n\n";
Expand Down
28 changes: 14 additions & 14 deletions app/Console/Templates/bootstrap/views/index.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<div class="<?php echo $pluralVar; ?> index">

<div class="row">
<div class="col-md-12">
<div class="col-lg-12">
<div class="page-header">
<h1><?php echo "<?php echo __('{$pluralHumanName}'); ?>"; ?></h1>
</div>
Expand All @@ -31,20 +31,20 @@

<div class="row">

<div class="col-md-3">
<div class="col-lg-3">
<div class="actions">
<div class="panel panel-default">
<div class="panel-heading"><?php echo "<?php echo __('Actions'); ?>";?></div>
<div class="panel-body">
<ul class="nav nav-pills nav-stacked">
<li><?php echo "<?php echo \$this->Html->link('<span class=\"glyphicon glyphicon-plus\"></span>&nbsp;&nbsp;'.__('New " . $singularHumanName . "'), array('action' => 'add'), array('escape' => false)); ?>"; ?></li>
<div class="card">
<div class="card-header"><?php echo "<?php echo __('Actions'); ?>";?></div>
<div class="card-body">
<ul class="nav nav-pills flex-column">
<li><?php echo "<?php echo \$this->Html->link('<span class=\"fa fa-plus\"></span>&nbsp;&nbsp;'.__('New " . $singularHumanName . "'), array('action' => 'add'), array('escape' => false)); ?>"; ?></li>
<?php
$done = array();
foreach ($associations as $type => $data) {
foreach ($data as $alias => $details) {
if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) {
echo "\t\t<li><?php echo \$this->Html->link('<span class=\"glyphicon glyphicon-list\"></span>&nbsp;&nbsp;List'.__('" . Inflector::humanize($details['controller']) . "'), array('controller' => '{$details['controller']}', 'action' => 'index'), array('escape' => false)); ?> </li>\n";
echo "\t\t<li><?php echo \$this->Html->link('<span class=\"glyphicon glyphicon-plus\"></span>&nbsp;&nbsp;New'.__('" . Inflector::humanize(Inflector::underscore($alias)) . "'), array('controller' => '{$details['controller']}', 'action' => 'add'), array('escape' => false)); ?> </li>\n";
echo "\t\t<li><?php echo \$this->Html->link('<span class=\"fa fa-list\"></span>&nbsp;&nbsp;List'.__('" . Inflector::humanize($details['controller']) . "'), array('controller' => '{$details['controller']}', 'action' => 'index'), array('escape' => false)); ?> </li>\n";
echo "\t\t<li><?php echo \$this->Html->link('<span class=\"fa fa-plus\"></span>&nbsp;&nbsp;New'.__('" . Inflector::humanize(Inflector::underscore($alias)) . "'), array('controller' => '{$details['controller']}', 'action' => 'add'), array('escape' => false)); ?> </li>\n";
$done[] = $details['controller'];
}
}
Expand All @@ -56,7 +56,7 @@
</div><!-- end actions -->
</div><!-- end col md 3 -->

<div class="col-md-9">
<div class="col-lg-9">
<table cellpadding="0" cellspacing="0" class="table table-striped">
<thead>
<tr>
Expand Down Expand Up @@ -87,9 +87,9 @@
}

echo "\t\t\t\t\t\t<td class=\"actions\">\n";
echo "\t\t\t\t\t\t\t<?php echo \$this->Html->link('<span class=\"glyphicon glyphicon-search\"></span>', array('action' => 'view', \${$singularVar}['{$modelClass}']['{$primaryKey}']), array('escape' => false)); ?>\n";
echo "\t\t\t\t\t\t\t<?php echo \$this->Html->link('<span class=\"glyphicon glyphicon-edit\"></span>', array('action' => 'edit', \${$singularVar}['{$modelClass}']['{$primaryKey}']), array('escape' => false)); ?>\n";
echo "\t\t\t\t\t\t\t<?php echo \$this->Form->postLink('<span class=\"glyphicon glyphicon-remove\"></span>', array('action' => 'delete', \${$singularVar}['{$modelClass}']['{$primaryKey}']), array('escape' => false), __('Are you sure you want to delete # %s?', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n";
echo "\t\t\t\t\t\t\t<?php echo \$this->Html->link('<span class=\"fa fa-search\"></span>', array('action' => 'view', \${$singularVar}['{$modelClass}']['{$primaryKey}']), array('escape' => false)); ?>\n";
echo "\t\t\t\t\t\t\t<?php echo \$this->Html->link('<span class=\"fa fa-edit\"></span>', array('action' => 'edit', \${$singularVar}['{$modelClass}']['{$primaryKey}']), array('escape' => false)); ?>\n";
echo "\t\t\t\t\t\t\t<?php echo \$this->Form->postLink('<span class=\"fa fa-remove\"></span>', array('action' => 'delete', \${$singularVar}['{$modelClass}']['{$primaryKey}']), array('escape' => false), __('Are you sure you want to delete # %s?', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n";
echo "\t\t\t\t\t\t</td>\n";
echo "\t\t\t\t\t</tr>\n";

Expand Down Expand Up @@ -125,4 +125,4 @@
</div><!-- end row -->


</div><!-- end containing of content -->
</div><!-- end containing of content -->
40 changes: 20 additions & 20 deletions app/Console/Templates/bootstrap/views/view.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
?>
<div class="<?php echo $pluralVar; ?> view">
<div class="row">
<div class="col-md-12">
<div class="col-lg-12">
<div class="page-header">
<h1><?php echo "<?php echo __('{$singularHumanName}'); ?>"; ?></h1>
</div>
Expand All @@ -28,24 +28,24 @@

<div class="row">

<div class="col-md-3">
<div class="col-lg-3">
<div class="actions">
<div class="panel panel-default">
<div class="panel-heading"><?php echo "<?php echo __('Actions'); ?>";?></div>
<div class="panel-body">
<ul class="nav nav-pills nav-stacked">
<div class="card">
<div class="card-header"><?php echo "<?php echo __('Actions'); ?>";?></div>
<div class="card-body">
<ul class="nav nav-pills flex-column">
<?php
echo "\t\t<li><?php echo \$this->Html->link(__('<span class=\"glyphicon glyphicon-edit\"></span>&nbsp&nbsp;Edit " . $singularHumanName ."'), array('action' => 'edit', \${$singularVar}['{$modelClass}']['{$primaryKey}']), array('escape' => false)); ?> </li>\n";
echo "\t\t<li><?php echo \$this->Form->postLink(__('<span class=\"glyphicon glyphicon-remove\"></span>&nbsp;&nbsp;Delete " . $singularHumanName . "'), array('action' => 'delete', \${$singularVar}['{$modelClass}']['{$primaryKey}']), array('escape' => false), __('Are you sure you want to delete # %s?', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?> </li>\n";
echo "\t\t<li><?php echo \$this->Html->link(__('<span class=\"glyphicon glyphicon-list\"></span>&nbsp&nbsp;List " . $pluralHumanName . "'), array('action' => 'index'), array('escape' => false)); ?> </li>\n";
echo "\t\t<li><?php echo \$this->Html->link(__('<span class=\"glyphicon glyphicon-plus\"></span>&nbsp&nbsp;New " . $singularHumanName . "'), array('action' => 'add'), array('escape' => false)); ?> </li>\n";
echo "\t\t<li><?php echo \$this->Html->link(__('<span class=\"fa fa-edit\"></span>&nbsp&nbsp;Edit " . $singularHumanName ."'), array('action' => 'edit', \${$singularVar}['{$modelClass}']['{$primaryKey}']), array('escape' => false)); ?> </li>\n";
echo "\t\t<li><?php echo \$this->Form->postLink(__('<span class=\"fa fa-remove\"></span>&nbsp;&nbsp;Delete " . $singularHumanName . "'), array('action' => 'delete', \${$singularVar}['{$modelClass}']['{$primaryKey}']), array('escape' => false), __('Are you sure you want to delete # %s?', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?> </li>\n";
echo "\t\t<li><?php echo \$this->Html->link(__('<span class=\"fa fa-list\"></span>&nbsp&nbsp;List " . $pluralHumanName . "'), array('action' => 'index'), array('escape' => false)); ?> </li>\n";
echo "\t\t<li><?php echo \$this->Html->link(__('<span class=\"fa fa-plus\"></span>&nbsp&nbsp;New " . $singularHumanName . "'), array('action' => 'add'), array('escape' => false)); ?> </li>\n";

$done = array();
foreach ($associations as $type => $data) {
foreach ($data as $alias => $details) {
if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) {
echo "\t\t<li><?php echo \$this->Html->link(__('<span class=\"glyphicon glyphicon-list\"></span>&nbsp&nbsp;List " . Inflector::humanize($details['controller']) . "'), array('controller' => '{$details['controller']}', 'action' => 'index'), array('escape' => false)); ?> </li>\n";
echo "\t\t<li><?php echo \$this->Html->link(__('<span class=\"glyphicon glyphicon-plus\"></span>&nbsp&nbsp;New " . Inflector::humanize(Inflector::underscore($alias)) . "'), array('controller' => '{$details['controller']}', 'action' => 'add'), array('escape' => false)); ?> </li>\n";
echo "\t\t<li><?php echo \$this->Html->link(__('<span class=\"fa fa-list\"></span>&nbsp&nbsp;List " . Inflector::humanize($details['controller']) . "'), array('controller' => '{$details['controller']}', 'action' => 'index'), array('escape' => false)); ?> </li>\n";
echo "\t\t<li><?php echo \$this->Html->link(__('<span class=\"fa fa-plus\"></span>&nbsp&nbsp;New " . Inflector::humanize(Inflector::underscore($alias)) . "'), array('controller' => '{$details['controller']}', 'action' => 'add'), array('escape' => false)); ?> </li>\n";
$done[] = $details['controller'];
}
}
Expand All @@ -57,7 +57,7 @@
</div><!-- end actions -->
</div><!-- end col md 3 -->

<div class="col-md-9">
<div class="col-lg-9">
<table cellpadding="0" cellspacing="0" class="table table-striped">
<tbody>
<?php
Expand Down Expand Up @@ -93,7 +93,7 @@
if (!empty($associations['hasOne'])) :
foreach ($associations['hasOne'] as $alias => $details): ?>
<div class="row related">
<div class="col-md-12">
<div class="col-lg-12">
<h3><?php echo "<?php echo __('Related " . Inflector::humanize($details['controller']) . "'); ?>"; ?></h3>
<table class="table table-striped">
<tbody>
Expand All @@ -110,7 +110,7 @@ if (!empty($associations['hasOne'])) :
</tbody>
</table>
<div class="actions">
<?php echo "<?php echo \$this->Html->link(__('Edit " . Inflector::humanize(Inflector::underscore($alias)) . "'), array('controller' => '{$details['controller']}', 'action' => 'edit', \${$singularVar}['{$alias}']['{$details['primaryKey']}']), array('escape' => false, 'class' => 'btn btn-default')); ?>\n"; ?>
<?php echo "<?php echo \$this->Html->link(__('Edit " . Inflector::humanize(Inflector::underscore($alias)) . "'), array('controller' => '{$details['controller']}', 'action' => 'edit', \${$singularVar}['{$alias}']['{$details['primaryKey']}']), array('escape' => false, 'class' => 'btn btn-primary')); ?>\n"; ?>
</div>
</div><!-- end col md 12 -->
</div>
Expand All @@ -129,7 +129,7 @@ foreach ($relations as $alias => $details):
$otherPluralHumanName = Inflector::humanize($details['controller']);
?>
<div class="related row">
<div class="col-md-12">
<div class="col-lg-12">
<h3><?php echo "<?php echo __('Related " . $otherPluralHumanName . "'); ?>"; ?></h3>
<?php echo "<?php if (!empty(\${$singularVar}['{$alias}'])): ?>\n"; ?>
<table cellpadding = "0" cellspacing = "0" class="table table-striped">
Expand All @@ -152,9 +152,9 @@ echo "\t<?php foreach (\${$singularVar}['{$alias}'] as \${$otherSingularVar}): ?
}

echo "\t\t\t<td class=\"actions\">\n";
echo "\t\t\t\t<?php echo \$this->Html->link(__('<span class=\"glyphicon glyphicon-search\"></span>'), array('controller' => '{$details['controller']}', 'action' => 'view', \${$otherSingularVar}['{$details['primaryKey']}']), array('escape' => false)); ?>\n";
echo "\t\t\t\t<?php echo \$this->Html->link(__('<span class=\"glyphicon glyphicon-edit\"></span>'), array('controller' => '{$details['controller']}', 'action' => 'edit', \${$otherSingularVar}['{$details['primaryKey']}']), array('escape' => false)); ?>\n";
echo "\t\t\t\t<?php echo \$this->Form->postLink(__('<span class=\"glyphicon glyphicon-remove\"></span>'), array('controller' => '{$details['controller']}', 'action' => 'delete', \${$otherSingularVar}['{$details['primaryKey']}']), array('escape' => false), __('Are you sure you want to delete # %s?', \${$otherSingularVar}['{$details['primaryKey']}'])); ?>\n";
echo "\t\t\t\t<?php echo \$this->Html->link(__('<span class=\"fa fa-search\"></span>'), array('controller' => '{$details['controller']}', 'action' => 'view', \${$otherSingularVar}['{$details['primaryKey']}']), array('escape' => false)); ?>\n";
echo "\t\t\t\t<?php echo \$this->Html->link(__('<span class=\"fa fa-edit\"></span>'), array('controller' => '{$details['controller']}', 'action' => 'edit', \${$otherSingularVar}['{$details['primaryKey']}']), array('escape' => false)); ?>\n";
echo "\t\t\t\t<?php echo \$this->Form->postLink(__('<span class=\"fa fa-remove\"></span>'), array('controller' => '{$details['controller']}', 'action' => 'delete', \${$otherSingularVar}['{$details['primaryKey']}']), array('escape' => false), __('Are you sure you want to delete # %s?', \${$otherSingularVar}['{$details['primaryKey']}'])); ?>\n";
echo "\t\t\t</td>\n";
echo "\t\t</tr>\n";

Expand All @@ -164,7 +164,7 @@ echo "\t<?php endforeach; ?>\n";
</table>
<?php echo "<?php endif; ?>\n\n"; ?>
<div class="actions">
<?php echo "<?php echo \$this->Html->link(__('<span class=\"glyphicon glyphicon-plus\"></span>&nbsp;&nbsp;New " . Inflector::humanize(Inflector::underscore($alias)) . "'), array('controller' => '{$details['controller']}', 'action' => 'add'), array('escape' => false, 'class' => 'btn btn-default')); ?>"; ?>
<?php echo "<?php echo \$this->Html->link(__('<span class=\"fa fa-plus\"></span>&nbsp;&nbsp;New " . Inflector::humanize(Inflector::underscore($alias)) . "'), array('controller' => '{$details['controller']}', 'action' => 'add'), array('escape' => false, 'class' => 'btn btn-primary')); ?>"; ?>
</div>
</div><!-- end col md 12 -->
</div>
Expand Down
Loading