This is an old revision of the document!
Table of Contents
PageViewModel
Layer: Core · Source: lib/core/Theme/PageViewModel.php:18 (lines 18–135)
final class PageViewModel extends AbstractThemeViewModel
Page view model.
Carries the already-escaped, display-ready fields for a static page rendered by page.php.
Docblock Metadata
^ Tag ^ Value ^ | ''@category'' | Theme | | ''@author'' | M.Noermoehammad | | ''@license'' | MIT | | ''@version'' | 1.0 |
Inheritance
^ Relation ^ Type ^ Meaning ^ | extends | [[scriptlog:lib:core:abstractthemeviewmodel|''AbstractThemeViewModel'']] | parent class/interface |
Constants (0)
None.
Properties (0)
None declared.
Methods (13)
^ Visibility ^ Method ^ Summary ^ Line ^ | public static | ''fromRow()'' | Build a page view model from a prepared row. | 27 | | public static | ''fromPrepared()'' | Build a page view model from already-prepared, already-safe values. | 69 | | public | ''id()'' | @psalm-suppress PossiblyUnusedMethod -- public getter consumed by public/themes | 81 | | public | ''title()'' | @psalm-suppress PossiblyUnusedMethod -- public getter consumed by public/themes | 86 | | public | ''url()'' | @psalm-suppress PossiblyUnusedMethod -- public getter consumed by public/themes | 91 | | public | ''slug()'' | @psalm-suppress PossiblyUnusedMethod -- public getter consumed by public/themes | 96 | | public | ''author()'' | @psalm-suppress PossiblyUnusedMethod -- public getter consumed by public/themes | 101 | | public | ''date()'' | @psalm-suppress PossiblyUnusedMethod -- public getter consumed by public/themes | 106 | | public | ''excerpt()'' | @psalm-suppress PossiblyUnusedMethod -- public getter consumed by public/themes | 111 | | public | ''content()'' | @psalm-suppress PossiblyUnusedMethod -- public getter consumed by public/themes | 116 | | public | ''media()'' | @psalm-suppress PossiblyUnusedMethod -- public getter consumed by public/themes | 121 | | public | ''mediaCaption()'' | @psalm-suppress PossiblyUnusedMethod -- public getter consumed by public/themes | 126 | | public | ''tags()'' | @psalm-suppress PossiblyUnusedMethod -- public getter consumed by public/themes | 131 |
fromRow()
public static function fromRow(array $row, callable $escape)
lines 27–53 (27)
Build a page view model from a prepared row.
^ Parameter ^ Type ^ Default ^ Description ^ | ''$row'' | ''array'' | //required// | //none// | | ''$escape'' | ''callable'' | //required// | //none// |
Returns: (none declared) — static
fromPrepared()
public static function fromPrepared(array $prepared)
lines 69–78 (10)
Build a page view model from already-prepared, already-safe values.
Mirrors PostViewModel::fromPrepared(): the values are escaped or sanitized exactly once at the normalization boundary (prepare_page()), so they are stored verbatim with no second escaping pass. Trusted sanitized HTML (content) must be passed as-is and printed as-is.
^ Parameter ^ Type ^ Default ^ Description ^ | ''$prepared'' | ''array'' | //required// | //none// |
Returns: (none declared) — static
id()
public function id(): ?string
lines 81–84 (4)
@psalm-suppress PossiblyUnusedMethod – public getter consumed by public/themes
Takes no parameters.
Returns: ?string
title()
public function title(): ?string
lines 86–89 (4)
@psalm-suppress PossiblyUnusedMethod – public getter consumed by public/themes
Takes no parameters.
Returns: ?string
url()
public function url(): string
lines 91–94 (4)
@psalm-suppress PossiblyUnusedMethod – public getter consumed by public/themes
Takes no parameters.
Returns: string
slug()
public function slug(): ?string
lines 96–99 (4)
@psalm-suppress PossiblyUnusedMethod – public getter consumed by public/themes
Takes no parameters.
Returns: ?string
author()
public function author(): ?string
lines 101–104 (4)
@psalm-suppress PossiblyUnusedMethod – public getter consumed by public/themes
Takes no parameters.
Returns: ?string
date()
public function date(): ?string
lines 106–109 (4)
@psalm-suppress PossiblyUnusedMethod – public getter consumed by public/themes
Takes no parameters.
Returns: ?string
excerpt()
public function excerpt(): ?string
lines 111–114 (4)
@psalm-suppress PossiblyUnusedMethod – public getter consumed by public/themes
Takes no parameters.
Returns: ?string
content()
public function content(): ?string
lines 116–119 (4)
@psalm-suppress PossiblyUnusedMethod – public getter consumed by public/themes
Takes no parameters.
Returns: ?string
media()
public function media(): ?string
lines 121–124 (4)
@psalm-suppress PossiblyUnusedMethod – public getter consumed by public/themes
Takes no parameters.
Returns: ?string
mediaCaption()
public function mediaCaption(): ?string
lines 126–129 (4)
@psalm-suppress PossiblyUnusedMethod – public getter consumed by public/themes
Takes no parameters.
Returns: ?string
tags()
public function tags(): ?string
lines 131–134 (4)
@psalm-suppress PossiblyUnusedMethod – public getter consumed by public/themes
Takes no parameters.
Returns: ?string
This page is generated from source by 'tools/gendoc'. Edits will be overwritten.
