Resource
public class Resource
Field Summary | |
---|---|
mixed |
Constructor Summary | |
---|---|
void | __construct(Application app, Request request, mixed urlParams) |
Method Summary | |
---|---|
Response | exec() Execute the resource, that is, find the correct resource method to call based upon the request and then call it. |
protected void | before(callable action) Add a function to execute on the request before the resource method is called |
protected void | after(callable action) Add a function to execute on the response after the resource method is called |
protected void | method(str method) HTTP method condition must match request method |
protected void | priority(int priority) Higher priority method takes precident over other matches |
protected void | accepts(str mimetype) Accepts condition mimetype must match request content type |
protected int | provides(str mimetype) Provides condition mimetype must be in request accept array, returns a number based on the priority of the match. |
protected int | lang(str language) Lang condition language code must be in request accept lang array, returns a number based on the priority of the match. |
protected void | cache(int length) Set cache control header on response |
public mixed $params
public void __construct(Application app, Request request, mixed urlParams)
public Response exec()
Execute the resource, that is, find the correct resource method to call based upon the request and then call it.
protected void before(callable action)
Add a function to execute on the request before the resource method is called
protected void after(callable action)
Add a function to execute on the response after the resource method is called
protected void method(str method)
HTTP method condition must match request method
protected void priority(int priority)
Higher priority method takes precident over other matches
protected void accepts(str mimetype)
Accepts condition mimetype must match request content type
protected int provides(str mimetype)
Provides condition mimetype must be in request accept array, returns a number based on the priority of the match.
protected int lang(str language)
Lang condition language code must be in request accept lang array, returns a number based on the priority of the match.
protected void cache(int length)
Set cache control header on response
Model a HTTP resource