Skip to content

Instantly share code, notes, and snippets.

@cesarockstar1985
Created March 13, 2023 12:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cesarockstar1985/b93aa72d08dace90ea2d8e6d972097b5 to your computer and use it in GitHub Desktop.
Save cesarockstar1985/b93aa72d08dace90ea2d8e6d972097b5 to your computer and use it in GitHub Desktop.
<?php
/**
* @var \App\View\AppView $this
*/
$this->extend('/Base/portletCollapsed');
$this->assign('portlet_title', $sectionHeader ?? __('Related Bonds'));
$this->start("portlet_body");
$columns = $this->Admin->getDatatableColumns($headers, false);
$niceAlias = 'Bonds';
$tableId = 'table-' . \Cake\Utility\Text::slug(mb_strtolower($niceAlias));
$modalId = 'modal-' . $tableId;
$isBondCategoryKey = array_key_exists('bond_category_id', $filter);
$checkBondCategoryId = $isBondCategoryKey ? 'true' : 'false';
$controller = $isBondCategoryKey ? 'BondTypes' : 'Bonds';
$datatable = [
'id' => $tableId,
'url' => \Cake\Routing\Router::url([
'prefix' => 'Admin',
'plugin' => false,
'controller' => $controller,
'action' => 'index',
'?' => $filter
]),
'historyUrl' => $this->getRequest()->getUri()->getPath(),
'columns' => $columns,
'filter' => true,
'noCount' => true,
];
$parentView->AssetCompress->script('CakeDC/Admin.datatable-index.js', ['block' => true]);
$parentView->Html->scriptStart(['block' => true]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment