PHP code example of zv / zview

1. Go to this page and download the library: Download zv/zview library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

zv / zview example snippets


<!--{if 1==2}--><html></html><!--{/if}-->

<form {if 1==2}method="post"{/if}>

<!--{template header.htm}-->
<!-- 默认.htm 后缀-->
<!--{template header}-->
<!-- 支持目录-->
<!--{template global/header}-->

<!--{if $a == $b && $b == 1}-->
    a = b AND b = $b
<!--{elseif $b == 2 || $a == 3}-->
    b = $b OR a = $a
<!--{elseif $a == 1}-->
    a = 1
<!--{else}-->
    a != 1
<!--{/if}-->

<!--{eval 
$a = 1;
$b = array(
   'a' => 1,
   'b' => 2,
);

if($a == 1) {
   print_r($b);
}

}-->

<!--{eval echo $my_var;}-->
<!--{eval $my_arr = array(1, 2, 3);}-->
<!--{eval print_r($my_arr);}-->
<!--{eval exit();}-->

<!--声明一个 block(名字不能重复)-->
<!--{block test($a = array(1,2,3,4))}-->
    <!--{loop $a $value}-->
        $value
    <!--{/loop}-->
<!--{/block}-->

<!--调用-->
{block_test(array(4,3,2,1))}