本文整理匯總了PHP中Rewrite::rewritePage方法的典型用法代碼示例。如果您正苦於以下問題:PHP Rewrite::rewritePage方法的具體用法?PHP Rewrite::rewritePage怎麽用?PHP Rewrite::rewritePage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Rewrite
的用法示例。
在下文中一共展示了Rewrite::rewritePage方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: dirname
<?php
define("IN_PERMALINK", TRUE);
require_once dirname(__FILE__) . "/maincore.php";
require_once CLASSES . "Rewrite.class.php";
// Starting Rewrite Object
$seo_rewrite = new Rewrite();
// Call the main function
$seo_rewrite->rewritePage();
// invoke the same here at rewrite.
// Type of Page
$filepath = $seo_rewrite->getFilePath();
if ($filepath != "") {
// Set FUSION_SELF to File path
if (preg_match("/\\.php/", basename($filepath))) {
// If it is a file
define("FUSION_SELF", ROOT . basename($filepath));
} else {
// If it is a directory that actually exists(like /forum/)
define("FUSION_SELF", "index.php");
}
// Define FUSION_QUERY
define("FUSION_QUERY", isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : "");
// Define START_PAGE for Panels
$current_page = str_replace($settings['site_path'], "", $_SERVER['PHP_SELF']);
define("TRUE_PHP_SELF", $current_page);
define("START_PAGE", TRUE_PHP_SELF . ($_SERVER['QUERY_STRING'] ? "?" . $_SERVER['QUERY_STRING'] : ""));
// Include the corresponding File
if ($_SERVER['PHP_SELF'] == $settings['opening_page']) {
include_once $settings['opening_page'];
} else {