Skip to content

PHP TEMPLATE ANALYSIS, It can quickly compile the original template and generate HTML display pages.

License

Notifications You must be signed in to change notification settings

yakeing/php_template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Template

PHP TEMPLATE ANALYSIS, It can quickly compile the original template and generate HTML display pages.

Travis CI badge

Travis-ci

codecov badge

codecov

Github badge

Downloads Size tag license languages

Installation

Use Composer to install the library. Of course, You can go to Packagist to view.

    $ composer require yakeing/php_template

Debugging Template

  • example
    //Template path
    $tpl = new template("/home/www/mould/");

    $tpl->assign("title","I was the title");
    $tpl->assign("arr",array('aaa','bbb','ccc'));

    //The transfer of files at the same time output
    $tpl->GetFile("header.html")->GetFile("index.html")->GetFile("footer.html")->render();

Format

  • example
    {if $array}...{elseif $array[0]!=null}...{else}...{/if}

foreach

  • example
    {foreach $array as $key => $value}...{$key} => {$value}...{/foreach}

while

  • example
    {$i = 1}...{while $i < $j}...{$i}...{$i++}...{/while}

for

  • example
    {for ($i=0;$i<count($array);$i++)}...{$array[$i]}...{/for}

switch

  • example
    {switch $str} ..{case 1}...{break}...{default}...{/switch}

assign OR calculation

  • example
    {$i = 1} OR {$t=2}
    {$i++}
    {$i--}

If you've got value from any of the content which I have created, then I would very much appreciate your support by payment donate.

Sponsor

Author

weibo: yakeing

twitter: yakeing

About

PHP TEMPLATE ANALYSIS, It can quickly compile the original template and generate HTML display pages.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published