Questions tagged [restler]

A micro framework that can expose any PHP class and its methods as Pragmatic and/or RESTful API.

Restler is a simple multi-format Web API Server written in PHP. It is open sourced under LGPL license.

258 questions
0
votes
1 answer

PHP Reslter 3 Wildcard and Custom Routing

I have this code on Restler and it returns 404 Not Found class CRUDEntity { /** * @url GET /entity/{entity_id}/books/* */ function getBatch($entity_id) { var_dump(func_get_args()); } } On the index page I have the…
0
votes
0 answers

Luracast restler 404: Not Found ../resources.json

Good night! I'm trying to use the restler, yet sempe have the same problem: 404: Not Found ../resources.json This is my .htaccess file DirectoryIndex index.php index.html RewriteEngine On RewriteBase /api/explorer …
Vera Rodrigues
  • 83
  • 1
  • 10
0
votes
1 answer

Restler doesn't auto route required parameters in URL

I'm using Restler 3, and am trying a very basic URL routing: GET /method/{param} My api class method gets param as the first required parameter, but he only gets it if I pass it through the request (GET /method?param=value) It seems from the…
Noam
  • 3,341
  • 4
  • 35
  • 64
0
votes
0 answers

How to use autoloader in Restler?

I have a problem with autoloading Restler. I wanted to use a bootstrap/autoloader in my application and looked at this tutorial, which was good for me as a PHP beginner. But it doesn't work with Restler. Why? Composer created/downloaded all files…
LuMa
  • 1,673
  • 3
  • 19
  • 41
0
votes
1 answer

RESTLER: use brackets to specify parameter

Similar to how OData does it, I want to use Luracast Restler with the following format to specifiy the id of an entity. @url GET entity({id}) instead of @url GET entity/{id} Is there any solution for this? If not, can this be handled by a…
Lauff
  • 1
0
votes
1 answer

How do you specify PHP version for Composer so that it won't download the latest builds?

I have shared hosting with PHP 5.3.8 where I cannot run Composer. Yesterday I have installed Composer to my own computer and then I have "build" Restler with it. It has downloaded Illuminate too. Then I've uploaded them to my shared hosting and it…
ilhan
  • 8,700
  • 35
  • 117
  • 201
0
votes
2 answers

How to have a "home" page when all is routed through index.php

I'm struggling with how to integrate Restler with a website. If we take the simplest example: hello world it requires that .htaccess route everything through index.php. But what if my home page needs to reside there? So for example, how can I…
0
votes
1 answer

Unable to get laravel/database and restler working with versioning

I have an existing website up and running, and now I want to add a REST interface to it in an api subdirectory. I'm not able to get this to work with versioning. I installed like so (no errors): $ php ~/bin/composer.phar create-project…
Gargoyle
  • 9,590
  • 16
  • 80
  • 145
0
votes
1 answer

Dynamic return status from restler

If I put an @status 201 in my function comments then that's what gets returned always on success. Is there a way to make that dynamic? For example, I have a putChild($child_id, $team_id) method defined. If the child is not already on the team,…
Gargoyle
  • 9,590
  • 16
  • 80
  • 145
0
votes
1 answer

DELETE methods not callable

I don't seem to be able to call DELETE methods via Restler for some reason. In my restler php file I've defined a method like so: /** * Drop invitation * * Removes an invitation from the system. Coaches want a way to be able …
Gargoyle
  • 9,590
  • 16
  • 80
  • 145
0
votes
1 answer

Cannot export response in csv format in Restler 3 rc5

I am having problem in exporting response in csv format in restler3 rc5. public function downloadCSV() { $array = array( "foo", "bar" ); return $array; } I am having the supported format line $r->setSupportedFormats('CsvFormat',…
user1602452
  • 65
  • 1
  • 1
  • 10
0
votes
2 answers

Download a CSV with Restler 3rc5

I'm trying to download a CSV using Restler 3rc5. In my index.php, I have CsvFormat set as a supported format. My API currently looks like this: /** * Download a CSV * * @status 200 * * @url GET /downloadCSV * */ public function…
zongweil
  • 2,031
  • 2
  • 21
  • 30
0
votes
1 answer

How to execute Restler::handle() with custom $request object?

I have have a resource GET /say/hello/:name. How can I get response from this resource with custom context? I am expecting this code:
Hong Truong
  • 821
  • 7
  • 11
0
votes
2 answers

Eloquent returning extra records

I've defined a model for Eloquent like this:
Gargoyle
  • 9,590
  • 16
  • 80
  • 145
0
votes
0 answers

Rewrites to Mac OSX WebApp not working

I've created a WebApp on Mac OS X 10.9. If I just go to something like the index.html it works fine, so I know the apache config there is working. Now I'm trying to get a rewrite rule to work for Restler and am having issues. My httpd.conf file…
Gargoyle
  • 9,590
  • 16
  • 80
  • 145