本文整理汇总了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 {