Création d'un controller “mydate.php” dans le répertoire “controller”
Implementation de la fonction “quel jour”
Création d'un vue dans le répertoire “views”
-
-
-
Code
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Mydate
*
*
* @package CodeIgniter
* @subpackage Rest Server
* @category Controller
* @author Julien Baudry
* @link http://
*/
// This can be removed if you use __autoload() in config.php OR use Modular Extensions
require APPPATH.'/libraries/REST_Controller.php';
class Mydate extends REST_Controller
{
function __construct()
{
// Construct our parent class
parent::__construct();
// Configure limits on our controller methods. Ensure
// you have created the 'limits' table and enabled 'limits'
// within application/config/rest.php
$this->methods['today_get']['limit'] = 500; //500 requests per hour per user/key
}
function QuelJour($parm) {
}
function today_get()
{
if(!$this->get('jour'))
{
$this->response(NULL, 400);
}
//appel de la fonction quel jour
if($jour)
{
//???
}
else
{
//???
}
}
}