Call single page inside AJAX tool script

Permalink
Hi all, i've kinda mess here.

I've a page which makes an AJAX call to a script in /tools/mytool.php. The script process some data and creates an array with the results.
Now i've the problem. I want to make a link to another single page using each component in the array.
For example, if my array = {1,2,3} then i want to create the following links:

http://www.mysite/mysinglepage/1
http://www.mysite/mysinglepage/2
http://www.mysite/mysinglepage/3

Inside a block i've used the method $this->url() and works fine. But, how i can accomplish the same result inside the php script tool?

Any ideas?

Thx in advance.

 
rcrow replied on at Permalink Best Answer Reply
Well, it was easy using the navigation helper:

$url = Loader::helper('navigation')->getCollectionURL(Page::getByPath(...));
$url .= $parameter;


You can use getById() if you want.


Hope it helps.
JohntheFish replied on at Permalink Reply
JohntheFish
After building a url with the nav helper, you can also use the url helper to build the query string.
http://www.concrete5.org/documentation/developers/helpers/urls/...

Or, going to the php function library there is http_build_query (and there are a few other php fns that do similar)
http://www.php.net/manual/en/function.http-build-query.php...
rcrow replied on at Permalink Reply
Like always, thx for your help JohntheFish ;)