You are here

public function Search404Controller::search404Goto in Search 404 8

Same name and namespace in other branches
  1. 2.x src/Controller/Search404Controller.php \Drupal\search404\Controller\Search404Controller::search404Goto()

Search404 drupal_goto helper function.

Parameters

string $path: Parameter used to redirect.

1 call to Search404Controller::search404Goto()
Search404Controller::search404Page in src/Controller/Search404Controller.php

File

src/Controller/Search404Controller.php, line 293

Class

Search404Controller
Route controller for search.

Namespace

Drupal\search404\Controller

Code

public function search404Goto($path = '') {

  // Set redirect response.
  $response = new RedirectResponse($path);
  if (\Drupal::config('search404.settings')
    ->get('search404_redirect_301')) {
    $response
      ->setStatusCode(301);
  }
  return $response
    ->send();
}