-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStonesController.php
More file actions
32 lines (28 loc) · 949 Bytes
/
StonesController.php
File metadata and controls
32 lines (28 loc) · 949 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
31
32
<?php
class StonesController extends AppController {
public function index(){
$elements = $this->Stone->find('all', array('order' => array('Stone.name' => 'ASC')));
//pr('<br /><br /><br />' . count($elements));
$this->set('elements', $elements);
}
public function edit($id){
if (!empty($this->request->data)) {
$this->Stone->create();
if ($this->Stone->save($this->request->data)) {
$this->redirect(array('action' => 'index'));
}
} else {
$this->Stone->locale = 'eng';
$this->data = $this->Stone->read(null, $id);
}
}
public function add(){
if (!empty($this->request->data)) {
$this->Stone->locale = Configure::read('Config.languages');
$this->Stone->create();
if ($this->Stone->save($this->request->data)) {
$this->redirect(array('action' => 'index'));
}
}
}
}