Recommend this page to a friend! |
Classes of Victor V. Nabatov | PHP Template Compiler | readme.md | Download |
|
DownloadTemplate Compiler.FeachuresHandles special tags and replaces them with commands of the php interpreter. Transforms template variables to php variables. It is able recursively execute functions and directives: FOREACH, IF, ELSE, ELSEIF, SWITCH, CASE, BREAK, DEFAULT, INCLUDE, CONTINUE. There is a possibility of compressing and caching the result. To control the compilation uses the HTML comment tags. This makes the template friendly and intuitive even for the inexperienced designer. RequirementsThis program requires PHP 5.4+ List of template functions
Template constants and variables{CONSTANT} means CONSTANT $variable means $variable $variable.index means $variable['index'] [$variable] or [$variable.index] is used in special case, ex. style="width:[$variable.width]px" \__$variable\__ or \__Any words\__ when you need translations into another language Example
Result
After finishing (removing newlines) the data file will be placed in one line. The original code: (https://github.com/Greenray/template-compiler). COPYRIGHT AND LICENSECopyright (C) 2016 Victor Nabatov <greenray.spb@gmail.com> This program is free software. You can redistribute it and/or modify it under the terms of the Creative Commons Attribution-ShareAlike 4.0 International License . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ??? ????????? ???????? ?????????. ?? ?????? ?????????????? ?/??? ?????????????? ?? ? ???????????? c ????????? Creative Commons Attribution-ShareAlike 4.0 International License . ??? ????????? ???????????????? ? ??????? ??? ??? ????? ????????, ?? ??? ?????-???? ????????; ???? ??? ??????????????? ???????? ???????????? ???????? ??? ??????????? ??? ?????????? ????. |