Skip to content

Commit

Permalink
Changing the naming convention on these fetches
Browse files Browse the repository at this point in the history
  • Loading branch information
Daren Sipes committed Apr 29, 2024
1 parent 39b1734 commit a8b4627
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 38 deletions.
4 changes: 2 additions & 2 deletions templates/bake/Template/index.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
*/
$this->extend('ButterCream./layout/index');
$this->assign('page_heading', '{{ pluralHumanName }}');
$this->assign('page.heading', '{{ pluralHumanName }}');
$this->assign('ajax_update_element', '#{{ pluralHumanName|lower|slug }}-pagination');
$this->Paginator->ajaxTemplateOptions($this->fetch('ajax_update_element'));
?>

<?php $this->start('index.card_buttons'); ?>
<?php $this->start('index.card.buttons'); ?>
<div class="btn-group btn-group-xs" role="group" aria-label="User Navigation">
<?= $this->Html->addBtn() ?>
{% set done = [] %}
Expand Down
4 changes: 2 additions & 2 deletions templates/bake/Template/view.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
* @var \{{ entityClass }} ${{ singularVar }}
*/
$this->extend('ButterCream./layout/view');
$this->assign('page_heading', '{{ singularHumanName }}');
$this->start('view.card_buttons');
$this->assign('page.heading', '{{ singularHumanName }}');
$this->start('view.card.buttons');
?>
<div class="btn-group btn-group-xs pull-right">
<?= $this->Html->actionDropdownMenu([
Expand Down
12 changes: 6 additions & 6 deletions templates/layout/error.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@
$bodyAttributes['class'] = array_unique($bodyAttributes['class']);
}

if (!$this->fetch('body_start')) {
$this->assign('body_start', $this->Html->tag('body', null, $bodyAttributes));
if (!$this->fetch('body.start')) {
$this->assign('body.start', $this->Html->tag('body', null, $bodyAttributes));
}

if (!$this->fetch('body_end')) {
$this->assign('body_end', '</body>');
if (!$this->fetch('body.end')) {
$this->assign('body.end', '</body>');
}

$this->append('script'); ?>
Expand Down Expand Up @@ -162,7 +162,7 @@ function each(els, cb) {
<?= $this->fetch('css') ?>
<?= $this->fetch('google_analytics') ?>
</head>
<?= $this->fetch('body_start') ?>
<?= $this->fetch('body.start') ?>
<?= $this->fetch('header') ?>
<div class="container-fluid">
<div class="row">
Expand Down Expand Up @@ -222,5 +222,5 @@ function each(els, cb) {
</div>
<?= $this->fetch('footer') ?>
<?= $this->fetch('script') ?>
<?= $this->fetch('body_end') ?>
<?= $this->fetch('body.end') ?>
</html>
2 changes: 2 additions & 0 deletions templates/layout/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
}
?>
<?php $this->layout == 'ajax' ? null : $this->extend('ButterCream./layout/common'); ?>
<?= $this->fetch('form.content.before') ?>
<div class="row">
<?= $this->fetch('content'); ?>
</div>
<?= $this->fetch('form.content.after') ?>
21 changes: 11 additions & 10 deletions templates/layout/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,34 @@
}
?>
<?php $this->layout == 'ajax' ? null : $this->extend('ButterCream./layout/common'); ?>
<?php if (!$this->fetch('index.card_footer') && $this->get('index.noCardFooter', false) !== true) : ?>
<?php $this->start('index.card_footer'); ?>
<?php if (!$this->fetch('index.card.footer') && $this->get('index.noCardFooter', false) !== true) : ?>
<?php $this->start('index.card.footer'); ?>
<div class="card-footer">
<?= $this->element('ButterCream.paginate') ?>
</div>
<?php $this->end(); ?>
<?php endif; ?>
<?= $this->fetch('index.before_card') ?>
<?= $this->fetch('index.card.before') ?>
<div class="card">
<div class="card-header">
<div class="row justify-content-between">
<div class="col-auto">
<?= $this->fetch('page_heading') ?>
<?php if ($this->fetch('page_description')) : ?>
<small><?= $this->fetch('page_description') ?></small>
<?= $this->fetch('page.heading') ?>
<?php if ($this->fetch('page.description')) : ?>
<small><?= $this->fetch('page.description') ?></small>
<?php endif; ?>
</div>
<?php if ($this->fetch('index.card_buttons')) : ?>
<?php if ($this->fetch('index.card.buttons')) : ?>
<div class="col-auto card-header-buttons">
<?= $this->fetch('index.card_buttons') ?>
<?= $this->fetch('index.card.buttons') ?>
</div>
<?php endif ?>
</div>
</div>
<?= $this->fetch('index.card_body') ?>
<?= $this->fetch('index.card.body') ?>
<div class="table-responsive">
<?= $this->fetch('content') ?>
</div>
<?= $this->fetch('index.card_footer') ?>
<?= $this->fetch('index.card.footer') ?>
</div>
<?= $this->fetch('index.card.after') ?>
12 changes: 6 additions & 6 deletions templates/layout/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@
$bodyAttributes['class'] = array_unique($bodyAttributes['class']);
}

if (!$this->fetch('body_start')) {
$this->assign('body_start', $this->Html->tag('body', null, $bodyAttributes));
if (!$this->fetch('body.start')) {
$this->assign('body.start', $this->Html->tag('body', null, $bodyAttributes));
}

if (!$this->fetch('body_end')) {
$this->assign('body_end', '</body>');
if (!$this->fetch('body.end')) {
$this->assign('body.end', '</body>');
}

/**
Expand Down Expand Up @@ -153,11 +153,11 @@
<?= $this->fetch('css') ?>
<?= $this->fetch('google_analytics') ?>
</head>
<?= $this->fetch('body_start') ?>
<?= $this->fetch('body.start') ?>
<?= $this->fetch('header') ?>
<?= $this->fetch('content') ?>
<?= $this->fetch('footer') ?>
<?= $this->fetch('script') ?>
<?= $this->fetch('modal') ?>
<?= $this->fetch('body_end') ?>
<?= $this->fetch('body.end') ?>
</html>
12 changes: 6 additions & 6 deletions templates/layout/pdf/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
$bodyAttributes['class'] = array_unique($bodyAttributes['class']);
}

if (!$this->fetch('body_start')) {
$this->assign('body_start', $this->Html->tag('body', null, $bodyAttributes));
if (!$this->fetch('body.start')) {
$this->assign('body.start', $this->Html->tag('body', null, $bodyAttributes));
}

if (!$this->fetch('body_end')) {
$this->assign('body_end', '</body>');
if (!$this->fetch('body.end')) {
$this->assign('body.end', '</body>');
}
?>
<!DOCTYPE html>
Expand All @@ -54,7 +54,7 @@
<title><?= $this->fetch('title') ?></title>
<?= $this->fetch('css') ?>
</head>
<?= $this->fetch('body_start') ?>
<?= $this->fetch('body.start') ?>
<div class="print-container">
<div class="container-fluid">
<div class="row">
Expand All @@ -64,5 +64,5 @@
</div>
</div>
</div>
<?= $this->fetch('body_end') ?>
<?= $this->fetch('body.end') ?>
</html>
14 changes: 8 additions & 6 deletions templates/layout/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,28 @@
}
?>
<?php $this->layout == 'ajax' ? null : $this->extend('ButterCream./layout/common'); ?>
<?= $this->fetch('view.card.before') ?>
<div class="card">
<div class="card-header">
<div class="row">
<div class="col-9">
<?= $this->fetch('page_heading') ?>
<?php if ($this->fetch('page_description')) : ?>
<small><?= $this->fetch('page_description') ?></small>
<?= $this->fetch('page.heading') ?>
<?php if ($this->fetch('page.description')) : ?>
<small><?= $this->fetch('page.description') ?></small>
<?php endif; ?>
</div>
<?php if ($this->fetch('view.card_buttons')) : ?>
<?php if ($this->fetch('view.card.buttons')) : ?>
<div class="col-3 text-end">
<?= $this->fetch('view.card_buttons') ?>
<?= $this->fetch('view.card.buttons') ?>
</div>
<?php endif ?>
</div>
</div>
<div class="card-body">
<?= $this->fetch('content') ?>
</div>
<?= $this->fetch('view.card_footer') ?>
<?= $this->fetch('view.card.footer') ?>
</div>
<?= $this->fetch('view.card.after') ?>

<?= $this->fetch('related_data') ?>

0 comments on commit a8b4627

Please sign in to comment.