mirror of
https://github.com/brmlab/brmsklad.git
synced 2025-08-02 06:13:35 +02:00
Added API
This commit is contained in:
parent
094b89463a
commit
b60a06e76b
2 changed files with 41 additions and 1 deletions
|
@ -8,4 +8,13 @@ class ItemsController extends AppController {
|
|||
'maxLimit' => 1000
|
||||
);
|
||||
|
||||
public function json_all(){
|
||||
die(json_encode($this->Item->find('all')));
|
||||
}
|
||||
|
||||
public function json_find($id = null){
|
||||
if($id == null || !is_numeric($id)) die(json_encode(array("error"=>true)));
|
||||
else die(json_encode($this->Item->find('all',array('conditions'=>array('barcode ='=>$id)))));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue