Skip to content

Instantly share code, notes, and snippets.

View philsturgeon's full-sized avatar
🌳
Planting Trees

Phil Sturgeon philsturgeon

🌳
Planting Trees
View GitHub Profile
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class REST_Controller extends Controller {
private $method;
private $format;
private $get_args;
private $put_args;
private $args;
<?php
require(APPPATH.'/libraries/REST_Controller.php');
class Example_api extends REST_Controller {
function user_get()
{
//$user = $this->some_model->getSomething( $this->get('id') );
$user = array('id' => $this->get('id'), 'name' => 'Some Guy', 'email' => 'example@example.com');
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* @author Philip Sturgeon
* @created 04/06/2009
*/
class REST {
private $CI; // CodeIgniter instance
<?php
class Rest_test extends Controller {
function __construct() {
parent::Controller();
$this->load->library('rest', array('server' => 'http://localhost/codeigniter/index.php/example_api/'));
}
function user_list()
/*
* jQuery Cycle plugin v0.2
* Philip Sturgeon [http://philsturgeon.co.uk]
*
* Licensed under the WTFPL License
* http://sam.zoy.org/wtfpl/
*/
(function($)
{
<?php
/**
* Matchbox Loader class
*
* This file is part of Matchbox
*
* Matchbox is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 4.3.2 or newer
*
* @package CodeIgniter
* @author Rick Ellis
* @copyright Copyright (c) 2006, EllisLab, Inc.
* @license http://www.codeignitor.com/user_guide/license.html
<?php
/*
* ExternalCMS Class
*
* This class abstracts the functionality of intergrating HL cms based sites with external CMS's
* How did this happen? Were there no other options? WHY AM I WRITING THIS?!
*
* @author Phil Sturgeon
*/
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* @author Philip Sturgeon
* @created 04/06/2009
*/
class REST {
private $CI; // CodeIgniter instance
function getCorrectIndex(i, date)
{
// find out what day of the week it is
var day_of_the_week = date.substr(0,3);
// define what days correspond to which array indices
var days = new Object();
days.Mon = [0,5,10,15,20];
days.Tue = [1,6,11,16,21];
days.Wed = [2,7,12,17,22];