I'm using CakePHP to produce a Facebook application (though the problem is not Facebook specific). As usual, I'm struggling to get the reverse routing to work properly. Previously I've abandoned the routing functionality, but this time I'd really like to make it work.
The problem is basically that Cake produces URLs relative to the base of the host server, but we need URLs relative to the Facebook canvas page. So, when I type:
echo $html->link(__('New Question', true), array('action'=>'add'));
I want it to produce "http://apps.facebook.com/appname/admin/questions/add", but it instead produces http://apps.facebook.com/foo/bar/appname/admin/questions/add", where foo/bar is the path from my host root to the app directory.
Having poked around the files in the config folder, I didn't see anything obvious. Any pointers?