Редакция 374 | К новейшей редакции | Весь файл | Не учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 374 | Редакция 375 | ||
---|---|---|---|
Строка 27... | Строка 27... | ||
27 | 27 | ||
28 | public function display($name) { |
28 | public function display($name) { |
29 | $fh = fopen($this->path.$name, "r"); |
29 | $fh = fopen($this->path.$name, "r"); |
30 | $content = fread($fh, filesize($this->path.$name)); |
30 | $content = fread($fh, filesize($this->path.$name)); |
31 | fclose($fh); |
31 | fclose($fh); |
32 | preg_match_all("/({[\d\w]+})/", $content, $matches); |
32 | preg_match_all("/{([\d\w]+)}/", $content, $matches); |
33 | $tmpl = $matches[0]; |
33 | $tmpl = $matches[1]; |
34 | for($i=0;$i<=count($tmpl);$i++) { |
34 | for($i=0;$i<=count($tmpl);$i++) { |
35 | $content = str_replace("{".$tmpl[$i]."}", $this->__get($tmpl[$i]), $content); |
35 | $content = str_replace("{".$tmpl[$i]."}", $this->__get($tmpl[$i]), $content); |
36 | }
|
36 | }
|
37 | 37 | ||
38 | echo $content; |
38 | echo $content; |