NanoFramework 1.5.2
A tiny PHP Framework
Loading...
Searching...
No Matches
View Class Reference

Parses files to insert data. More...

Public Member Functions

 parseFile (string $source, array $variables=[], array $rawVariables=[])
 
 parse (string $content, array $variables=[], array $rawVariables=[])
 

Detailed Description

Parses files to insert data.

This class allows the parsing of files to include specific data.

Definition at line 10 of file View.php.

Member Function Documentation

◆ parse()

parse ( string $content,
array $variables = [],
array $rawVariables = [] )

This method takes a string formatted with the template engine syntax (see TemplateEngineSyntax for more information) and inserts the data before returning it.

All the data in $variables will be escaped before being inserted. Those in $rawVariables won't.

Parameters
string$contentthe string in which to insert data
array$variablesthe associative array containing variables to be escaped
array$rawVariablesthe associative array containing variables not to be escaped
Returns
string The input string with the data inserted

Definition at line 37 of file View.php.

◆ parseFile()

parseFile ( string $source,
array $variables = [],
array $rawVariables = [] )

This method takes the path of a file, reads from it and parses it using the View::parse method. See that one for mor information.

Parameters
string$sourcethe path of the file
array$variablesthe variables to insert
array$rawVariablesthe secure variables to insert
Returns
string A string containing the file content, with the data inserted

Definition at line 21 of file View.php.


The documentation for this class was generated from the following file: