Hi.
I've been googling this for the last half an hour, and no success.
I cannot find any good tutorial about url_handlers.
What I need to make working is:
1. I have a MyPage class and an instance with a following URLSegment: 'http://mydomain.com/mypage'
2. Now I need to support ANY action in this page class: 'http://mydomain.com/mypage/lorem' should open 'http://mydomain.com/mypage' with Action param: 'lorem'.
I declared this in MyPage_Controller:
public static $url_handlers = array(
'' => 'index',
'$Action' => 'index',
);
public function index() {
print_r($this->getRequest()->params());
return array();
}
but calling http://mydomain.com/mypage/lorem gives me the following error:
[Warning] substr() expects parameter 1 to be string, array given
GET /mypage/lorem
Line 79 in /var/www/vhosts/pitax.internetex.pl/htdocs/framework/control/ContentNegotiator.php
However it prints the params correctly:
Array ( [URLSegment] => mypage [Action] => lorem [ID] => [OtherID] => [Controller] => ModelAsController )
so that 'lorem' is considered as an Action.
anyone know what's wrong here?