php-cg-select-v2/examples/index.php

43 lines
807 B
PHP
Raw Permalink Normal View History

2023-06-08 01:35:51 +03:00
<?php
require_once '../vendor/autoload.php';
$widget = new \Itguild\PhpCgSelect\CGSelect(".cg-dropdown_selector", [
'placeholder' => 'Choose a car',
'label' => 'Example',
'name' => 'some',
'items' => [
'BMW',
[
'id' => 1,
'title' => 'Opel',
'value' => 23,
],
'Lada'
],
'styles' => [
'head' => [
'width' => '500px',
]
],
])
?>
<html>
<head>
<title>PHP CG-Select Example</title>
<?php \Itguild\PhpCgSelect\CGSelect::renderCDN(); ?>
</head>
<body>
<div>
<form action="">
<button class="cg-dropdown_selector"></button>
<button type="submit">Оправить</button>
</form>
</div>
<script>
<?php echo $widget->getJS() ?>
</script>
</body>
</html>