Skip to content

Internals Redirect Breadcrumbs BreadCrumbs

Stefan Crkvenjakov edited this page Oct 7, 2026 · 1 revision

redirect\breadcrumbs\BreadCrumbs

Framework Internals · Subsystem overview · Developer guide

Source: awt_src/classes/redirect/breadcrumbs/BreadCrumbs.php · Snapshot 8411f4287706.

Redirect stores a target consumed by the web bootstrap. Breadcrumbs keeps the last rendered page in the PHP session.

Imports and dependencies

use session\SessionHandler;

BreadCrumbs

Declaration and architectural role

class BreadCrumbs extends SessionHandler

Source description (behavioral corrections are recorded in Known discrepancies):

The BreadCrumbs class extends the SessionHandler class and is responsible for managing the last visited page (breadcrumbs) in a session.

Constants, enum cases, traits and properties

Declarations below preserve visibility, type, default and modifiers exactly. A typed property without an initializer remains uninitialized until its constructor or another method assigns it. Mutable fields belong to this instance unless marked static; readonly fields can be initialized once. Constructor-promoted properties are also listed below.

Member Declaration Purpose or source contract
$last private string $last; Used by __construct(), setLast(), getLast().

Method index

Method Signature
__construct public function __construct()
setLast public function setLast(): void
getLast public function getLast(): string

__construct

Source line 15

public function __construct()

State writes: $this->last.

Implementation, validation guards and interaction order
public function __construct()
    {
        $this->SessionHandler();

        if (isset($_SESSION['last_page'])) {
            $this->last = $_SESSION["last_page"];
        } else {
            $this->last = $_SERVER["REQUEST_URI"];
            $_SESSION["last_page"] = $this->last;
        }

    }

setLast

Source line 34

public function setLast(): void

Sets the last page URL to the current page URL and stores it in the session.

This method updates both the $last property and the session's last_page variable to the current request URI ($_SERVER["REQUEST_URI"]).

State writes: $this->last.

Implementation, validation guards and interaction order
/**
     * Sets the last page URL to the current page URL and stores it in the session.
     *
     * This method updates both the `$last` property and the session's `last_page` variable
     * to the current request URI (`$_SERVER["REQUEST_URI"]`).
     */
    public function setLast(): void
    {
        $this->last = $_SERVER["REQUEST_URI"];
        $_SESSION["last_page"] = $this->last;
    }

getLast

Source line 45

public function getLast(): string

Returns the last visited page URL.

@return string The value of $last, which stores the last page visited.

Return expressions (including local callbacks): $this->last.

Implementation, validation guards and interaction order
/**
     * Returns the last visited page URL.
     *
     * @return string The value of `$last`, which stores the last page visited.
     */
    public function getLast(): string
    {
        return $this->last;
    }

Related types

Clone this wiki locally