-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmanage.php
More file actions
30 lines (21 loc) · 785 Bytes
/
manage.php
File metadata and controls
30 lines (21 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
include'vendor/autoload.php';
$app = new Warehouse();
$m = $app->stickyGET('model');
$m = basename($m); // for security
$m = new $m($app->db);
// for security
if (!$m instanceof \atk4\data\Model) {
throw new Exception('Incorrect model definition');
}
$cr = $app->layout->add('CRUD');
$cr->setModel($m);
/*
$cr->addColumn(new \atk4\ui\TableColumn\Template('<a href="article.php?article_id={$id}"><i class="stack overflow icon"></i> {$name}: {$stock} in stock</a>'));
$cr->fieldsGrid = ['category', 'brand', 'name'];
$cr->setModel(new Article($app->db));
$cr->menu->addItem(new ui\Manager(['Brands', 'icon'=>'tag']))
->setModel(new Brand($app->db));
$cr->menu->addItem(new ui\Manager(['Categories', 'icon'=>'folder']))
->setModel(new Category($app->db));
*/