コード例 #1
0
ファイル: Request.php プロジェクト: kakserpom/WakePHP
 public function onFinish()
 {
     if ($this->components !== null) {
         $this->components->cleanup();
         $this->components = null;
     }
     if ($this->tpl !== null) {
         $this->tpl->assign('req', null);
         $this->tpl = null;
     }
     //Daemon::log('onFinish -- ' . $_SERVER['REQUEST_URI']);
 }
コード例 #2
0
ファイル: caching.php プロジェクト: tombouctou/quicky
<?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);
コード例 #3
0
ファイル: lastrock.php プロジェクト: tombouctou/quicky
$form->addElement('num', array('name' => 'num'));
$form->addElement('startbtn', new QButton(array('name' => 'submit')));
if ($_SESSION['lastrock_action'] == 'play') {
    if ($playform->btn1->clicked()) {
        $humantake = 1;
    } elseif ($playform->btn2->clicked()) {
        $humantake = 2;
    } elseif ($playform->btn3->clicked()) {
        $humantake = 3;
    } else {
        $humantake = 0;
    }
    if ($humantake) {
        $_SESSION['lastrock_num'] -= $humantake;
        $_SESSION['lastrock_who'] = TRUE;
        $tpl->assign('humantake', $humantake);
        if ($_SESSION['lastrock_num'] == 0) {
            $_SESSION['lastrock_action'] = 'intro';
            $_SESSION['lastrock_gameover'] = TRUE;
            header('Location: ' . $_SERVER['PHP_SELF']);
            exit;
        }
    }
    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);
コード例 #4
0
ファイル: string.php プロジェクト: tombouctou/quicky
<?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->assign('myvar', 'myvalue');
$tpl->load_string('myname', '{$myvar|escape}');
$fn = 'string://myname';
$tpl->display($fn);
echo '<hr />' . (microtime(TRUE) - MICROTIME_START);
echo '<hr />';
highlight_file($p = $tpl->_get_compile_path($fn, ''));
echo '<hr />';
highlight_file($tpl->_get_template_path($fn));
echo '<hr />';
highlight_file(__FILE__);
コード例 #5
0
ファイル: debug.php プロジェクト: tombouctou/quicky
<?php

chdir('..');
require_once '../Quicky.class.php';
define('MICROTIME_START', microtime(TRUE));
error_reporting(E_ALL);
ini_set('display_errors', 'On');
$tpl = new Quicky();
//$tpl->compiler_prefs['inline_includes'] = TRUE;
$tpl->force_compile = TRUE;
$tpl->debug_mode = TRUE;
$tpl->plugins_dir[] = QUICKY_DIR . 'customplugins/';
//$tpl->depart_scopes = TRUE;
//$tpl->compile_check = FALSE;
$tpl->assign('testvariable', 'testvalue');
$fn = '|debug.tpl';
$tpl->display($fn);
echo '<br />' . (microtime(TRUE) - MICROTIME_START);
echo '<hr />';
highlight_file($tpl->_get_compile_path($fn, ''));
echo '<hr />';
highlight_file($tpl->template_dir . $fn);
コード例 #6
0
ファイル: simple.php プロジェクト: tombouctou/quicky
<?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->assign('Name', 'Fred Irving Johnathan Bradley Peppergill');
$tpl->assign('FirstName', array('John', 'Mary', 'James', 'Henry'));
$tpl->assign('LastName', array('Doe', 'Smith', 'Johnson', 'Case'));
$tpl->assign('Class', array(array('A', 'B', 'C', 'D'), array('E', 'F', 'G', 'H'), array('I', 'J', 'K', 'L'), array('M', 'N', 'O', 'P')));
$tpl->assign('contacts', array(array('phone' => '1', 'fax' => '2', 'cell' => '3'), array('phone' => '555-4444', 'fax' => '555-3333', 'cell' => '760-1234')));
$tpl->assign('option_values', array('NY', 'NE', 'KS', 'IA', 'OK', 'TX'));
$tpl->assign('option_output', array('New York', 'Nebraska', 'Kansas', 'Iowa', 'Oklahoma', 'Texas'));
$tpl->assign('option_selected', 'NE');
$tpl->config_load('test.conf');
$fn = 'simple/index.tpl';
$tpl->display($fn);
echo '<br />' . (microtime(TRUE) - MICROTIME_START);
echo '<hr />';
highlight_file($tpl->_get_compile_path($fn, ''));
echo '<hr />';
highlight_file($tpl->template_dir . $fn);
コード例 #7
0
ファイル: misc.php プロジェクト: tombouctou/quicky
<?php

define('MICROTIME_START', microtime(TRUE));
require_once '../Quicky.class.php';
error_reporting(E_ALL);
ini_set('display_errors', 'On');
$tpl = new Quicky();
$tpl->assign('myFunc', function () {
    return 'myResult';
});
$tpl->force_compile = TRUE;
//$tpl->compile_check = FALSE;
$fn = 'syntax/misc.tpl';
$tpl->display($fn);
echo '<hr />' . (microtime(TRUE) - MICROTIME_START);
echo '<hr />';
highlight_file($p = $tpl->_get_compile_path($fn, ''));
echo '<hr />';
highlight_file($tpl->_get_template_path($fn));