SKOR PHP模板
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SKOR PHP模板相关的知识,希望对你有一定的参考价值。
Skor php Template class can assign individual variable values or arrays with several variable values. A separate sub-class extends the base class to support delimited template section replacements.
<?php /** * class section "Intro" * **/ $sec = new section(); $sec->read(); /** * class section "Hello world" * **/ $sec->assign_section('Head'); $sec->assign('HALLO','Hi World'); $sec->assign_section('Example'); /** * class section "Alternating table rows" * **/ $tbody = ''; for($i = 0; $i <= 5; $i++){ $sec->assign('COUNTER', $i); $tbody .= $sec->fetch('RowGreen'); }else{ $tbody .= $sec->fetch('RowRed'); } } $sec->assign('TBODY',$tbody); $sec->assign_section('Table'); /** * class section "Nested sections with two children" * **/ $sec->assign('PLACEHOLDER','placeholder'); $sec->assign('MOTHER',$sec->fetch('ChildOne') . $sec->fetch('ChildTwo')); $sec->assign_section('Mother'); /** * class section footer" * **/ $sec->assign_section('End'); ?>
以上是关于SKOR PHP模板的主要内容,如果未能解决你的问题,请参考以下文章