Question

I am trying to set up Philip Sturgeon’s REST Library. I did exactly what the Readme file told me to do:

Drag and drop the application/libraries/Format.php and application/libraries/REST_Controller.php files into your application’s directories. Either autoload the REST_Controller class or require_once it at the top of your controllers to load it into the scope. Additionally, copy the rest.php file from application/config in your application’s configuration directory.

I dragged three files into corresponding folders. I also checked out this article on Nettus: http://net.tutsplus.com/tutorials/php/working-with-restful-services-in-codeigniter-2/

I try to autoload it using:

$autoload['libraries'] = array('REST_Controller', 'database', 'session', 'form_validation'); 

I also tried

$autoload['packages'] = array(APPPATH.'REST_Controller', '/libraries/REST_Controller.php'); 

And then at last I tried:

require(APPPATH'.libraries/REST_Controller.php'); 

They all don’t work. Also I’m very certain I am using CodeIgniter 2.1.4, because I downloaded fresh from the main website.

Does anyone know what’s going on?

By they don't work, I mean the server crashed (I use MAMP).

Was it helpful?

Solution

Please try this may be it will work for you because its working fine for me.

require APPPATH.'/libraries/REST_Controller.php';

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top