System:Template:createAjaxUrl

From Aspen Documentation

Creates a url that is properly encoded for an ajax query. This will not use any clean urls.

Since 1.0

Contents

Arguments

string createAjaxUrl ([string $method = false], [array $bits = false], [string $module = false], [string $interface = false])

method
The class method ("page") to generate a link to. If left false, it will generate a link to the current method.
bits
An array of values to append to the url. For example, array('id'=>1) will append either: /page/1 or &method=page&id=1.
module
The module the method exists within. If left false, the current module is assumed.
interface
The interface the module exists within. If left false, the current module is assumed.

Returns

Returns an absolute url as a string.

Notes

  • This function will not be available for external resources. Only applications running within the framework may utilize it.

Examples

Generating a URL to the view page of the current module:

$this->createAjaxUrl('view');