12-12-2009, 02:57 PM
|
رقم المشاركة : 1 |
|
| محرك قوالب جديد ومختلف تماما Templights السلام عليكــــــــــــــــــــــم
انا اليوم وجدت محرك قوالب مختلف عن المحركات الاخرى
وهو يعتمد بشكل كبير على البى اتش بى نفسها فى الصفحات الهتمل اما اذا كنت تريد ان ترى ملف دون الاخر ستجد الملف الاساسى هنا
ويحتوى على 32 ملف
امثلة على المحرك
التعليقات | | | {%% هذا تعليق اى لن ينفذ ما بداخله! %%}
|
وهذا التكرار | | |
{% LIST {
<? if ($list) : ?>
<ul>
<? foreach ($list as $item) : ?>
<li><?= $item; ?></li>
<? endforeach; ?>
</ul>
<? endif; ?>
}%} | مثال رقم واحد صفحة البى اتش بى | | | <?php
require '../templights/base.php';
tpl_path(dirname(__FILE__).'/templates');
$tpl = tpl_load('webpage.tpl');
echo tpl_render($tpl, array(
'title' => 'Example2',
'content' => 'Example of multiple inheritance'
)); |
صفحة الـ webpage.tpl | | |
{%% extend template layout.tpl %%}
{% layout.tpl {
{%% override content of block TITLE %%}
{% TITLE {
example.com - <?= $title ?>
}%}
{%% override content of block HEAD %%}
{% HEAD {
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
}%}
{%% override content of block BODY %%}
{% BODY {
<h1><?= $title; ?></h1>
<div id="content"><?= $content ?></div>
<div id="footer">
{%% define block TITLE %%}
{% FOOTER {
{%%
extend template footer.tpl with no blocks defined (template include)
extra text is appended
%%}
{% footer.tpl { Gregor Mazovec }%}
}%}
</div>
}%}
}%} |
|
| | |