function action_goto_action

Redirects to a different URL.

Action functions are declared by modules by implementing hook_action_info(). Modules can cause action functions to run by calling actions_do().

Parameters

object $entity: An optional node entity, which will be added as $context['node'] if provided.

array $context: Array with the following elements:

  • 'url': URL to redirect to. This will be passed through token_replace().
  • Other elements will be used as the data for token replacement.
1 string reference to 'action_goto_action'
ConfigurationTest::testActionConfiguration in drupal/core/modules/action/lib/Drupal/action/Tests/ConfigurationTest.php
Tests configuration of advanced actions through administration interface.

File

drupal/core/modules/action/action.module, line 711
This is the Actions module for executing stored actions.

Code

function action_goto_action($entity, $context) {
  drupal_goto(token_replace($context['url'], $context));
}