Neuron-PHP

FileTemplateEngine
in package
implements ITemplateEngine

File-based template engine for loading stub files

Table of Contents

Interfaces

ITemplateEngine
Template engine for loading and rendering stub files

Properties

$fs  : IFileSystem
$stubPath  : string

Methods

__construct()  : mixed
exists()  : bool
Check if a template exists
load()  : string|null
Load raw template content
render()  : string
Render template with data replacements

Properties

Methods

exists()

Check if a template exists

public exists(string $template) : bool
Parameters
$template : string

Template name (e.g., 'controller.resource.stub')

Tags
inheritDoc
Return values
bool

load()

Load raw template content

public load(string $template) : string|null
Parameters
$template : string

Template name

Tags
inheritDoc
Return values
string|null

Template content or null if not found

render()

Render template with data replacements

public render(string $template, array<string|int, mixed> $data) : string
Parameters
$template : string

Template name

$data : array<string|int, mixed>

Key-value pairs for {{placeholder}} replacement

Tags
inheritDoc
Return values
string

Rendered content


        
On this page

Search results