Mithril now can walks by itself

This commit is contained in:
2017-10-05 16:41:34 +07:00
parent ae762758fc
commit cfa0924ea7
26 changed files with 4299 additions and 1524 deletions

View File

@@ -16,7 +16,6 @@ class Api
public function posts($args = ['id' => '1'])
{
$get = [];
$get['count'] = 0;
if ($args['id'] == 3) {
$get['data'] = $this->model->showJoin();
@@ -42,10 +41,6 @@ class Api
$temp_data = [];
}
if ($get['data'] != false) {
$get['count'] = count($get['data']);
}
header('Content-Type: application/json');
echo json_encode($get);
}

View File

@@ -291,6 +291,12 @@ class Posts
Redirect::to('/posts/category');
}
} else {
// Calculate delay by character
// 60 characters for 5 secs
// 1 character for 84 ms
$length = strlen($args['content']);
$args['delay'] = $length * 84;
if ($this->model->entry($args)) {
Session::flash('info', 'Data berhasil diunggah');
Redirect::to('/');
@@ -348,6 +354,12 @@ class Posts
}
}
// Calculate delay by character
// 60 characters for 5 secs
// 1 character for 84 ms
$length = strlen($args['content']);
$args['delay'] = $length * 84;
if ($this->model->update($args, $id)) {
Session::flash('info', 'Data berhasil diperbarui');
Redirect::to('/');