Plugin Framework Function refreshPluginSlotAnchor()

public final function refreshPluginSlotAnchor(
$requests = '', $scrollToTopOfSlot = true, $fadeOutAndIn = true
)

Summary

Generates attributes for a hyperlink that will cause your Plugin to reload via AJAX.

Where You Can Use It

Can be used in methods called by plugins. From Zenario 7.0.0 onwards.

Description

The attributes generated will include a JavaScript command to reload your Plugin, plus a normal href link for anyone who has JavaScript turned off.

The inputs needed are the same as the refreshPluginSlotJS() utility function. If you're adding links to a Theme then it is recommended that you call both functions and put the results into two different Merge Fields, so that Theme creators have a choice of which they use.

Parameters

$requests

Any GET requests you wish the Plugin to see as it is reloaded. Should be in the format:

request1=value&request2=value

Note that you can't use POST. If you need POST then you should use a form instead; see the openForm utility function for details.

$scrollToTopOfSlot

From version 5.2.2, you can use this parameter to control whether the Visitor's page should scroll back up to the top of the Slot when it is refreshed.

$fadeOutAndIn

From version 6.0, you can use this parameter to control whether or not the Slot should become semi-transparent while the AJAX call is in progress.

Return Value

The HTML attributes needed for the link.

Example

$this->mergeFields['Anchor_Link'] = $this->refreshPluginSlotAnchor('request=value');
<a <!--Anchor_Link-->><!--_CLICK_ON_THIS_LINK--></a>

This example illustrates how to put a link on a theme.