@yield('title', 'Slide')
@extension('message')

@section('breadcrumb')
<h2>Slide</h2>
<h3>
    <a href="{-route('create')-}">Thêm mới</a>
</h3>
@endsection

@php
	$extensionOption = [
		'name' => 'table-slide',
		'title' => 'slide',
		'controller_url' => $this->route('index'),
		'custom_value_column' => [
			'name' => function($v) {
				return html_entity_decode($v['name']);
			},
			'url' => function($v) {
				if($v) {
					return '<a href="' . base_url($v['url']) . '" target="_black">Xem url</a>';
				}
				return false;
			},
			'display_page' => function($v) {
				if($v['display_page']) {
					return '<a href="' . base_url($v['display_page']) . '" target="_black">Xem trang</a>';
				}
				return false;
			}
		],
		'column_index' => ['small_image'],
		'checkbox_action' => [
			'display' => [
				'url' => $this->route('display'),
				'confirm' => 'Bạn có chắc muốn <b>{yes=hiện thị}</b><b>{no=ẩn}</b> slide {name}?'
			]
		]
	];
@endphp

@extension('datatable', 'SlideModel', $extensionOption)