first commit
This commit is contained in:
48
examples/category.php
Normal file
48
examples/category.php
Normal file
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
require_once '../vendor/autoload.php';
|
||||
|
||||
$widget = new \Itguild\PhpCgSelect\CGSelect(".cg-dropdown_selector", [
|
||||
'placeholder' => 'Choose a car',
|
||||
'label' => 'Example',
|
||||
'searchMode' => true,
|
||||
'items' => [
|
||||
[
|
||||
'category' => 'Russia',
|
||||
'categoryItems' => [
|
||||
['id' => 1, 'title' => 'Москва', 'value' => 1],
|
||||
'Саратов',
|
||||
'Волгоград',
|
||||
'Донецк',
|
||||
]
|
||||
],
|
||||
[
|
||||
'category' => 'USA',
|
||||
'categoryItems' => [
|
||||
'Alabama',
|
||||
'Texas',
|
||||
'Los-Angeles',
|
||||
]
|
||||
],
|
||||
]
|
||||
])
|
||||
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<title>PHP CG-Select Category 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>
|
43
examples/index.php
Normal file
43
examples/index.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?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>
|
Reference in New Issue
Block a user