2019-03-30 12:19:46 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Controllers;
|
|
|
|
|
2019-08-15 13:05:13 +00:00
|
|
|
use Core\Model;
|
2019-03-30 12:19:46 +00:00
|
|
|
use \Core\View;
|
2019-08-15 13:05:13 +00:00
|
|
|
use App\Models;
|
2019-03-30 12:19:46 +00:00
|
|
|
/**
|
|
|
|
* Home controller
|
|
|
|
*
|
|
|
|
* PHP version 7.0
|
|
|
|
*/
|
|
|
|
class Home extends \Core\Controller
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Show the index page
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2019-08-15 13:05:13 +00:00
|
|
|
public function indexAction() {
|
2019-03-30 12:19:46 +00:00
|
|
|
$ret = [];
|
|
|
|
$ret[1] = "hello";
|
|
|
|
//View::renderTemplate('Home/index.html');
|
|
|
|
$this->JsonResp(200,$ret,"OK");
|
|
|
|
}
|
2019-08-15 13:05:13 +00:00
|
|
|
public function usersAction() {
|
|
|
|
$user = Models\User::getAll();
|
|
|
|
$this->JsonResp(200,$user,"OK");
|
|
|
|
}
|
|
|
|
public function insertAction() {
|
|
|
|
|
|
|
|
}
|
|
|
|
public function renderAction() {
|
2019-08-21 07:34:08 +00:00
|
|
|
View::renderTemplate("/Home/index.html",[]);
|
2019-03-30 12:19:46 +00:00
|
|
|
}
|
2019-08-16 18:28:53 +00:00
|
|
|
public function docsAction(){
|
|
|
|
$docs = new Models\Doc();
|
2019-08-18 15:51:59 +00:00
|
|
|
$ret = $docs->getAll();
|
|
|
|
$this->JsonResp(200,$ret,"OK");
|
2019-08-16 18:28:53 +00:00
|
|
|
}
|
2019-03-30 12:19:46 +00:00
|
|
|
}
|
2019-08-16 18:28:53 +00:00
|
|
|
|