Controller :: redirect()

Redirect to another page.

Description

public static function redirect($strLocation, $intStatus = 303)

Location in Contao 3: system/modules/core/library/Contao/Controller.php
Location in Contao 4: vendor/contao/core-bundle/src/Resources/contao/library/Contao/Controller.php

Parameters

  1. string $strLocation

    The destination URL (relative to Contao base or an absolute URL).

  2. integer $intStatus

    A valid HTTP status code.

    • 301 – Moved Permanently
    • 302 – Found
    • 303 – See Other (default)

Examples

  1. Redirect to the calendar page

     <?php
    
     \Controller::redirect('calendar.html');
    

results matching ""

    No results matching ""