Ubiquity
2.5.2
php rapid development framework
Loading...
Searching...
No Matches
TemplateParser.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Ubiquity\views\engine\micro
;
4
14
class
TemplateParser {
15
private
$fileContent;
16
17
public
function
__construct($fileName) {
18
$this->fileContent = $this->parse ( \file_get_contents ( $fileName ) );
19
}
20
21
private
function
parse($html) {
22
$startPoint =
'{{'
;
23
$endPoint =
'}}'
;
24
$result = \preg_replace (
'/('
. \preg_quote ( $startPoint ) .
')(.*?)('
. \preg_quote ( $endPoint ) .
')/sim'
,
'<?php echo $2 ?>'
, $html );
25
return
$result;
26
}
27
28
public
function
__toString() {
29
return
$this->fileContent;
30
}
31
}
Ubiquity\views\engine\micro
Definition
MicroTemplateEngine.php:3
C:
Users
myadd
Documents
GitHub
ubiquity-doc-api
vendor
phpmv
ubiquity
src
Ubiquity
views
engine
micro
TemplateParser.php
Generated on Sun Dec 10 2023 15:04:28 for
Ubiquity
by
doxygen
1.9.8