Skip to content
Artem Khitsenko edited this page Jan 30, 2021 · 2 revisions

Class: View

Namespace: Afoslt\Core

Parent: -

Modifiers: -

View for websites based on MVC pattern powered by Afoslt core.


Fields

$viewName

Modifiers: private

Name of file that will be used as view.

Relative to views directory.

$arguments

Modifiers: private

Associative array of variables that view will be using when rendered.

$title

Modifiers: private

Title of view.

If set to null will get default value from manifest.

Will be put in tag <title>.

Properties

SetArguments (?array $arguments): void

Modifiers: public final

Setter for field $arguments.

GetArguments (): array

Modifiers: public final

Getter for field $arguments.

SetTitle (?string $title): void

Modifiers: public final

Setter for field $title.

GetTitle (): ?string

Modifiers: public final

Getter for field $title.

GetViewName (): string

Modifiers: protected final

Getter for field $viewName.

Methods

__construct (string $viewName, ?array $arguments = null, ?string $title = null)

Modifiers: public

View for websites based on MVC pattern powered by Afoslt core.

  • $viewName Name of file that will be rendered.
  • $arguments [optional] Associative array of variables.
  • $title [optional] Title of view.

Render (): void

Modifiers: public final

Render view to the client.

FileName (?string $viewName): ?string

Modifiers: public final static

Get View file name.

Return path to file relative to views directory. Returns null if $viewName was empty.

Exists (?string $viewName): bool

Modifiers: public final static

Check if view exists.

Returns true if view file exists.