Here's an ongoing problem I've encountered: how can I easily get the URL for a given CMP or some other manager controller? I've found having to cobble something together to do this in PHP and in Javascript. In my CMP's, I'll often do something like this:
$a = (int) (isset($_GET['a'])) ? $_GET['a'] : '';
// then store it somewhere and do something like:
return '?a='.$a; // return the manager URL
That works, but it's soooo scrappy. And it doesn't really help when I'm trying to link to some other CMP.
Finally, in JS, sometimes you can reference things like:
MODx.action['namespace:index']
And you can get the base URL of your CMP, but that variable is not always in scope.
Anyhow, does anyone have an elegant solution to this problem?