Zed. The source code to build a world.

StoryHook
in package

AbstractYes

Story hook class

This class allows to hook PHP code to a textual story.

It allows the story to be completed by site elements.

For a class implementation example:

Tags
see
DemoStoryHook

Table of Contents

Properties

$perso  : Perso
The character involved in the story
$section  : mixed
$story  : Story
The current story

Methods

__construct()  : mixed
Constructor
add_content()  : string
Adds HTML code *AT THE END* of the story content block
add_html()  : string
Adds HTML code *AFTER* the content block
get_choices_links()  : void
Gets choices extra links
initialize()  : void
Initializes hook. Called after constructor.
update_description()  : void
Updates description

Properties

$perso

The character involved in the story

public Perso $perso

$section

public mixed $section

Methods

__construct()

Constructor

public __construct(Story $story, StorySection $section) : mixed
Parameters
$story : Story

The story including this hook

$section : StorySection

The section including this hook

add_content()

Adds HTML code *AT THE END* of the story content block

public add_content() : string
Return values
string

add_html()

Adds HTML code *AFTER* the content block

public add_html() : string
Return values
string

Gets choices extra links

public get_choices_links(array<string|int, string> &$links) : void
Parameters
$links : array<string|int, string>

the hooks links array

initialize()

Initializes hook. Called after constructor.

public abstract initialize() : void

update_description()

Updates description

public update_description(string &$description) : void
Parameters
$description : string

the description text (from section and previous hooks)


        
On this page

Search results