I'm trying to make this work. I want my routing to behave like this:
when I type URL ie. example.com/api/getpage/http://smth.com
I want to retrieve in my action id
parameter with http://smth.com
value.
My routing for this case looks like this right now:
Route::set('api', 'api/<action>/<id>')
->defaults(array(
'controller' => 'api',
'action' => 'index'
));
And what's in action:
public function action_getpage()
{
$obj = $this->scrape($this->request->query('id'));
$this->response->body(json_encode($obj));
}
Now URL like this example.com/api/getpage?id=http://smth.com
works like a charm, but I don't want it that way. Is there any way to achieve that goal? Thanks in advance for all suggestions.