<?php require_once '../Quicky.class.php'; define('MICROTIME_START', microtime(TRUE)); error_reporting(E_ALL); ini_set('display_errors', 'On'); $tpl = new Quicky(); //$tpl->force_compile = TRUE; //$tpl->compile_check = FALSE; $fn = 'caching/index.tpl'; if (isset($_REQUEST['clear'])) { $tpl->clear_cache($fn, '*'); } $tpl->caching = 1; $tpl->cache_lifetime = 60; // ������ if (!$tpl->is_cached('index.tpl')) { $tpl->assign('var', '�����-������ ��������, ��������, �� ��'); } $tpl->display($fn);
<?php require_once '../Quicky.class.php'; define('MICROTIME_START', microtime(TRUE)); error_reporting(E_ALL); ini_set('display_errors', 'On'); $tpl = new Quicky(); //$tpl->force_compile = TRUE; //$tpl->compile_check = FALSE; $tpl->detect_form('test'); $tpl->display($fn = 'form/form_detection.tpl'); $form = $tpl->getFormByName('test'); echo 'Entered value: ' . htmlspecialchars($form->textbox1->getValue()); echo '<hr />' . (microtime(TRUE) - MICROTIME_START); echo '<hr />'; highlight_file($tpl->_get_compile_path($fn, '')); echo '<hr />'; highlight_file($tpl->template_dir . $fn); echo '<hr />'; highlight_file(__FILE__);
} if ($phrase = 'BYE') { return 'Пока'; } } else { if ($phrase = 'HI') { return 'Hi'; } if ($phrase = 'BYE') { return 'Bye'; } } } function quicky_lang_callback($m) { return lang_getmessage($m[1]); } function quicky_lang_callback_e($m) { return addslashes(lang_getmessage($m[1])); } $tpl->lang_callback = 'quicky_lang_callback'; $tpl->lang_callback_e = 'quicky_lang_callback_e'; $tpl->display($fn = 'multilang.tpl'); echo '<hr />' . (microtime(TRUE) - MICROTIME_START); echo '<hr />'; highlight_file(__FILE__); echo '<hr />'; highlight_file($tpl->_get_template_path($fn)); echo '<hr />'; highlight_file($tpl->_get_compile_path($fn, ''));
} } if ($_SESSION['lastrock_who']) { $comp = $_SESSION['lastrock_num'] - (floor(($_SESSION['lastrock_num'] - 1) / 4) * 4 + 1); if ($comp == 0) { $comp = 1; } $_SESSION['lastrock_num'] -= $comp; $_SESSION['lastrock_who'] = FALSE; $tpl->assign('comptake', $comp); } } else { if ($form->startbtn->clicked()) { if ($form->num->addFilter('digit', 'isn\'t number') and $form->num->getValue() > 100) { $form->num->error('number may not be greater then 100'); } if ($form->_num_of_errors == 0) { $_SESSION['lastrock_action'] = 'play'; $_SESSION['lastrock_num'] = $form->num->getValue(); $_SESSION['lastrock_who'] = !(($_SESSION['lastrock_num'] - 1) % 4 == 0); header('Location: ' . $_SERVER['PHP_SELF']); } } } $tpl->assign('action', $_SESSION['lastrock_action']); $tpl->display($fn = 'lastrock.tpl'); echo '<hr />' . (microtime(TRUE) - MICROTIME_START); echo '<hr />'; highlight_file(__FILE__); echo '<hr />'; highlight_file($tpl->_get_template_path($fn));