I couldn't google this one. The question;
public function processAPI() {
if (method_exists($this, $this->endpoint)) {
return $this->_response($this->{$this->endpoint}($this->args));
}
return $this->_response("No Endpoint: $this->endpoint", 404);
}
Consider $endpoint
is a variable and $args
is an array of a class. We want to pass the variable $this->{$this->endpoint}($this->args)
to _response()
method. What does {$this->endpoint}($this->args)
means in php syntax?
The link of full definition of code: http://coreymaynard.com/blog/creating-a-restful-api-with-php/