Bootstrap->table([ 'hover' => false, ], [ 'fields' => [ ['key' => 'label', 'label' => __('Label')], ['key' => 'name', 'label' => __('Name')], ['key' => 'url', 'label' => __('URL'), 'formatter' => function ($value, $row) { return sprintf('%s', h($value)); }], ['key' => 'action', 'label' => __('Action'), 'formatter' => function ($value, $row, $index) { return $this->Bootstrap->button([ 'icon' => 'trash', 'variant' => 'danger', 'size' => 'sm', 'params' => [ 'onclick' => sprintf('deleteBookmark(window.bookmarks[%s])', $index), ] ]); }], ], 'items' => $bookmarks, 'caption' => empty($bookmarks) ? __('No bookmark saved') : '' ]); ?>