/** * Process PHP * * @access private */ private function process_php() { if (file_exists($this->_common_php_path) || file_exists($this->_page_php_path)) { KYWeb::page()->html($this->_result_html); if (file_exists($this->_common_php_path)) { require_once $this->_common_php_path; } if (file_exists($this->_page_php_path)) { require_once $this->_page_php_path; } $this->_result_html = KYWeb::page()->process()->result(); } return $this; }
<html> <body> {VAR1} {VAR2} </body> </html> <?php // Library objects $page = KYWeb::page(); $page->assign("VAR1", "Hello"); $page->assign("VAR2", "World"); // or $page->assign(array("VAR1" => "Hello", "VAR2" => "World"));
<?php /** * KYMailクラス * * @license http://apache.org/licenses/LICENSE-2.0 * * @copyright ©kyphone */ KYWeb::refuse_direct_access(".inc.php"); /** * KYMailクラスはテンプレートからメールを作成、送信します。 * * メールのテンプレートは `/private/mail` フォルダに `*.txt` として保存します。 * * @license http://apache.org/licenses/LICENSE-2.0 * * @copyright ©kyphone */ class KYMail { /** @var object|null KYMailのインスタンス */ private static $_instance = null; /** @var string テンプレート */ private $_template; /** @var array 書き換え配列 */ private $_assign; /** @var string 件名 */ private $_subject; /** @var string 本文 */ private $_body;
<?php require_once dirname(__FILE__) . "/require.inc.php"; echo KYWeb::instance()->process()->result();
<?php // Library objects $api = KYWeb::api(); $access_token = $api->get_headers_token();
<?php KYWeb::refuse_direct_access(".sql.php"); function qGET_SAMPLE($db, $params = NULL) { $user_id = $db->int($params["user_id"]); $sql = "SELECT * FROM `m_user` WHERE `user_id` = {$user_id}"; return $sql; }
<?php require_once dirname(__FILE__) . "/require.inc.php"; KYWeb::instance()->process();