Documentation

helpers.php

Home Page View Helpers

Pure helper functions used by index.php to render parts of the home page. Kept in a separate file so the view itself only contains side-effect HTML output, satisfying PSR-12.

PHP version 8.1

Tags
category

Lwt

author

HugoFara hugo.farajallah@protonmail.com

license

Unlicense http://unlicense.org/

link
https://hugofara.github.io/lwt/developer/api
since
3.0.0

Table of Contents

Functions

renderWordPressLogout()  : void
When on a WordPress server, render a logout button.
renderHomeConfig()  : void
Output the JSON config element read by home_app.ts.
renderSuggestionsGrid()  : void
Render the suggestions card grid (reused for onboarding and main page).

Functions

renderWordPressLogout()

When on a WordPress server, render a logout button.

renderWordPressLogout(bool $isWordPress, string $base) : void
Parameters
$isWordPress : bool

Whether WordPress session is active

$base : string

The application base path

renderHomeConfig()

Output the JSON config element read by home_app.ts.

renderHomeConfig(array<string|int, mixed>|null $lastTextInfo, string $base, int $textCount, int $currentlang) : void
Parameters
$lastTextInfo : array<string|int, mixed>|null

Current text info for Alpine.js initial state

$base : string

The application base path

$textCount : int

Number of texts for current language

$currentlang : int

Current language ID

renderSuggestionsGrid()

Render the suggestions card grid (reused for onboarding and main page).

renderSuggestionsGrid() : void

Must be called inside a gutenbergSuggestions Alpine scope.


        
On this page

Search results