当前位置: 首页>>代码示例>>PHP>>正文


PHP Functions::getPublicFileURL方法代码示例

本文整理汇总了PHP中Functions::getPublicFileURL方法的典型用法代码示例。如果您正苦于以下问题:PHP Functions::getPublicFileURL方法的具体用法?PHP Functions::getPublicFileURL怎么用?PHP Functions::getPublicFileURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Functions的用法示例。


在下文中一共展示了Functions::getPublicFileURL方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getPublicFile

 public static function getPublicFile($name = "index.php", $template = "", $lang = "")
 {
     if ($filename = Functions::getPublicFileURL($name, $template, $lang)) {
         return file_get_contents($filename);
     }
     return false;
 }
开发者ID:youssefbenhssaien,项目名称:MVC-PHP,代码行数:7,代码来源:Functions.php

示例2: init

 public function init(array $request = array())
 {
     $defaultcontrolfilename = Functions::getPublicFileURL("../servlet/index.php");
     $defaultviewfilename = Functions::getPublicFileURL("index.html");
     if (isset($this->request["REQUEST_URI"][0]) && !empty($this->request["REQUEST_URI"][0])) {
         if (Functions::isLanguage($this->request["REQUEST_URI"][0])) {
             $this->setLanguage(array_shift($this->request["REQUEST_URI"]));
         }
     } elseif (!in_array(parent::getUserBrowser(), array("ie"))) {
         $redirectforlanguage = true;
     }
     if (isset($this->request["REQUEST_URI"][0]) && !empty($this->request["REQUEST_URI"][0])) {
         $controlfilename = Functions::getPublicFileURL("../servlet/" . $this->request["REQUEST_URI"][0] . ".php");
         $viewfilename = $this->request["REQUEST_URI"][0] . ".html";
         if (is_file($controlfilename)) {
             include $controlfilename;
         } elseif (is_file($viewfilename)) {
             $this->showPage($viewfilename);
         } else {
             $this->showPage("404.html");
         }
     } else {
         if (is_file($defaultcontrolfilename)) {
             include $defaultcontrolfilename;
         } elseif (is_file($defaultviewfilename)) {
             include $defaultviewfilename;
         }
     }
     if (isset($redirectforlanguage)) {
         echo "<script>history.pushState('page', '', '" . Functions::getDefaultURL() . $this->getLanguage() . "/');</script>";
     }
 }
开发者ID:youssefbenhssaien,项目名称:MVC-PHP,代码行数:32,代码来源:DefaultServlet.php

示例3: init

 public function init(array $request = array())
 {
     $this->initConstant();
     $defaultcontrolfilename = Functions::getPublicFileURL(SERVLET_SUBFOLDER . "index.php");
     $defaultviewfilename = Functions::getPublicFileURL("index.php");
     if (isset($this->request["REQUEST_URI"][0]) && !in_array(parent::getUserBrowser(), array("ie"))) {
         if (!in_array("ajax", $this->request["REQUEST_URI"])) {
             echo "<script>history.pushState('page', '', '" . Functions::getDefaultURL() . parent::getLanguage() . "/" . Config::$DEFAULT_SERVLET_NAME . "/" . implode("/", $this->request["REQUEST_URI"]) . "');</script>";
         }
         $controlfilename = Functions::getPublicFileURL(SERVLET_SUBFOLDER . $this->request["REQUEST_URI"][0] . ".php");
         $viewfilename = $this->request["REQUEST_URI"][0] . ".html";
         if (is_file($controlfilename)) {
             include $controlfilename;
         } elseif (is_file($viewfilename)) {
             $this->showPage($viewfilename);
         } else {
             include Functions::getPublicFileURL(INCLUDE_SUBFOLDER . "head.php");
             $this->showPage("404.html");
         }
     } else {
         if (is_file($defaultcontrolfilename)) {
             include $defaultcontrolfilename;
         } elseif (is_file($defaultviewfilename)) {
             include $defaultviewfilename;
         }
     }
 }
开发者ID:youssefbenhssaien,项目名称:MVC-PHP,代码行数:27,代码来源:PanelServlet.php

示例4: dispatch

function dispatch($name, $adminO, $object, $request = array())
{
    switch ($name) {
        case "ajax":
            verifyLogin($name, $adminO, $object, $request);
            break;
        case "logout":
            $object->unsetConnected();
            Functions::jsRedirect($adminO::getAdminURL());
            break;
        default:
            if (!$object->isConnected()) {
                include Functions::getPublicFileURL(CURRENT_PAGE_NAME . ".php");
            } else {
                Functions::jsRedirect($adminO::getAdminURL());
            }
    }
}
开发者ID:youssefbenhssaien,项目名称:MVC-PHP,代码行数:18,代码来源:login.php

示例5:

<?php

$admin = Models::getAdminObject();
$request = $this->request;
if ($admin->isConnected()) {
    include Functions::getPublicFileURL(INCLUDE_SUBFOLDER . "head.php");
    include Functions::getPublicFileURL(INCLUDE_SUBFOLDER . "header.php");
    include Functions::getPublicFileURL(INCLUDE_SUBFOLDER . "left.header.php");
    include Functions::getPublicFileURL("index.php");
    include Functions::getPublicFileURL(INCLUDE_SUBFOLDER . "footer.php");
} else {
    Functions::jsRedirect($this::getAdminURL() . "login");
}
开发者ID:youssefbenhssaien,项目名称:MVC-PHP,代码行数:13,代码来源:index.php

示例6: array

        case "gallerypictures":
            return array("%%PICTURE%%" => $object->getPicture());
            break;
        case "category":
            return array("%%ID%%" => $object->getId(), "%%NAME%%" => $object->getName());
            break;
    }
    return array();
}
if (strcmp("fr", Config::$CURRENT_LANGUAGE) == 0) {
    $current = "-page";
} else {
    $current = "";
}
$this->html->setCommonArray(array("%%INDEXCLASS%%" => "", "%%PORTFOLIO%%" => "current" . $current, "%%BLOG%%" => "", "%%SERVICES%%" => "", "%%ABOUT%%" => "", "%%CONTACT%%" => ""));
echo $this->html->getFilteredText(Functions::getPublicFile("includes/head.html"));
echo $this->html->getFilteredText(Functions::getPublicFile("includes/header.html"));
$gallerypictures = Models::getGalleryObject();
$gallery = Models::getGalleryObject();
$category = Models::getCategoryObject();
$pagename = "portfolio";
if (isset($this->request["REQUEST_URI"][1]) && $gallery->existId(substr($this->request["REQUEST_URI"][1], 0, strpos($this->request["REQUEST_URI"][1], "_")))) {
    $gallery->fetchGalleryById(substr($this->request["REQUEST_URI"][1], 0, strpos($this->request["REQUEST_URI"][1], "_")));
    $gallerypictures->fetchAllFiles(substr($this->request["REQUEST_URI"][1], 0, strpos($this->request["REQUEST_URI"][1], "_")));
    $pagename = "portfolio.detail";
} else {
    $gallery->fetchAllGalleries();
}
$category->fetchCategoryByType("gallery");
echo $this->html->getReplacedHTMLRepeatedBlockByModelObject(array("gallery" => $gallery, "gallerypictures" => $gallerypictures, "category" => $category), Functions::getPublicFileURL("pages/" . $pagename . ".html"), "getReplaceChars");
echo $this->html->getFilteredText(Functions::getPublicFile("includes/footer.html"));
开发者ID:youssefbenhssaien,项目名称:MVC-PHP,代码行数:31,代码来源:portfolio.php

示例7: reload

<?php

$pagename = "administrator";
$object = Models::getAdminObject();
?>
<div class="rightpanel">
	<ul class="breadcrumbs">
		<li><a href="<?php 
echo $adminO::getAdminDir();
?>
"><i class="iconfa-home"></i></a> <span class="separator"></span></li>
		<li><a href="<?php 
echo $adminO::getAdminDir() . $pagename;
?>
">Liste des administrateurs</a></li>
	</ul>
	<div>
		<?php 
include Functions::getPublicFileURL(PAGE_LIST_SUBFOLDER . $pagename . ".php");
?>
	</div>
</div>
<script>
		function reload(){
			reloadLastProduct();
			reloadAdministrator();
			reloadHeader();
		}
</script>
开发者ID:youssefbenhssaien,项目名称:MVC-PHP,代码行数:29,代码来源:administrator.php

示例8: array

        case "slide":
            return array("%%PICTURE%%" => $object->getPicture());
            break;
        case "category":
            $product = Models::getProductObject();
            $product->fetchProductByCategoryId($object->getId());
            return array("%%ID%%" => $object->getId(), "%%NAME%%" => $object->getName(), "%%CATEGORY_URL%%" => Functions::getDefaultURL() . "product/" . str_replace(" ", "_", $object->getName()), "%%PICTURE%%" => $object->getPicture(), "%%LOGO%%" => $object->getLogo(), "%%DESCRIPTION%%" => $object->getDescription(), "%%COUNT%%" => $product->getCount(), "%%SELECTED%%" => defined("CATEGORY_NAME") && $object->getIdFromName(str_replace("_", " ", CATEGORY_NAME)) == $object->getId() ? "selected" : "");
            break;
    }
    return array();
}
if (strcmp("fr", Config::$CURRENT_LANGUAGE) == 0) {
    $current = "-page";
} else {
    $current = "";
}
$this->html->setCommonArray(array("%%INDEXCLASS%%" => "current" . $current, "%%PORTFOLIO%%" => "", "%%PRODUCT%%" => "", "%%BLOG%%" => "", "%%SERVICES%%" => "", "%%ABOUT%%" => "", "%%CONTACT%%" => ""));
$category = Models::getCategoryObject();
$product = Models::getProductObject();
$gallery = Models::getGalleryObject();
$improve = Models::getImproveObject();
$slide = Models::getSlideObject();
$category->fetchCategoryByType("product");
$product->fetchAllProducts(0, 4);
$gallery->fetchAllGalleries(0, 4);
$improve->fetchAllImproves();
$slide->fetchAllFiles();
echo $this->html->getFilteredText(Functions::getPublicFile("includes/head.html"));
echo $this->html->getFilteredText(Functions::getPublicFile("includes/header.html"));
echo $this->html->getReplacedHTMLRepeatedBlockByModelObject(array("category" => $category, "products" => $product, "gallery" => $gallery, "slide" => $slide, "improve" => $improve, "improve1" => $improve), Functions::getPublicFileURL("index.html"), "getReplaceChars");
echo $this->html->getFilteredText(Functions::getPublicFile("includes/footer.html"));
开发者ID:youssefbenhssaien,项目名称:MVC-PHP,代码行数:31,代码来源:index.php

示例9: getReplaceChars

<?php

function getReplaceChars($object, $name = "")
{
    switch ($name) {
        case "improve":
            return array("%%ID%%" => $object->getId(), "%%NAME%%" => $object->getName(), "%%CONTENT%%" => $object->getContent(), "%%PICTURE%%" => $object->getPicture());
            break;
        case "improve1":
            return array("%%ID%%" => $object->getId());
            break;
    }
    return array();
}
if (strcmp("fr", Config::$CURRENT_LANGUAGE) == 0) {
    $current = "-page";
} else {
    $current = "";
}
$datetime1 = new DateTime(date("Y-m-d"));
$datetime2 = new DateTime('1986-01-01');
$interval = $datetime1->diff($datetime2);
$this->html->setCommonArray(array("%%INDEXCLASS%%" => "", "%%PORTFOLIO%%" => "", "%%BLOG%%" => "", "%%SERVICES%%" => "", "%%ABOUT%%" => "current" . $current, "%%CONTACT%%" => "", "%%AGE%%" => $interval->format('%y')));
$improve = Models::getImproveObject();
$improve->fetchAllImproves();
echo $this->html->getFilteredText(Functions::getPublicFile("includes/head.html"));
echo $this->html->getFilteredText(Functions::getPublicFile("includes/header.html"));
echo $this->html->getReplacedHTMLRepeatedBlockByModelObject(array("improve" => $improve, "improve1" => $improve), Functions::getPublicFileURL("pages/about.html"), "getReplaceChars");
echo $this->html->getFilteredText(Functions::getPublicFile("includes/footer.html"));
开发者ID:youssefbenhssaien,项目名称:MVC-PHP,代码行数:29,代码来源:about.php

示例10: array

            return array("%%ID%%" => $object->getId(), "%%NAME%%" => $object->getName(), "%%CATEGORY_URL%%" => Functions::getDefaultURL() . "product/" . str_replace(" ", "_", $object->getName()), "%%PICTURE%%" => $object->getPicture(), "%%DESCRIPTION%%" => $object->getDescription(), "%%COUNT%%" => $product->getCount(), "%%SELECTED%%" => defined("CATEGORY_NAME") && $object->getIdFromName(str_replace("_", " ", CATEGORY_NAME)) == $object->getId() ? "selected" : "");
            break;
    }
    return array();
}
$page = "product";
if (isset($this->request["REQUEST_URI"][1])) {
    define("CATEGORY_NAME", $this->request["REQUEST_URI"][1]);
}
if (strcmp("fr", Config::$CURRENT_LANGUAGE) == 0) {
    $current = "-page";
} else {
    $current = "";
}
$this->html->setCommonArray(array("%%INDEXCLASS%%" => "", "%%PORTFOLIO%%" => "", "%%BLOG%%" => "", "%%PRODUCT%%" => "current" . $current, "%%SERVICES%%" => "", "%%ABOUT%%" => "", "%%CONTACT%%" => ""));
echo $this->html->getFilteredText(Functions::getPublicFile("includes/head.html"));
echo $this->html->getFilteredText(Functions::getPublicFile("includes/header.html"));
$product = Models::getProductObject();
$category = Models::getCategoryObject();
$title = "Nos produits";
if (defined("CATEGORY_NAME") && $product->existCategoryId($category->getIdFromName(str_replace("_", " ", CATEGORY_NAME)))) {
    $product->fetchProductByCategoryId($category->getIdFromName(str_replace("_", " ", CATEGORY_NAME)));
    $title = ucfirst(str_replace("_", " ", CATEGORY_NAME));
    $page = "product.detail";
} else {
    $product->fetchProductByDistinctCategory();
}
$category->fetchCategoryByType("product");
$this->html->setCommonArray(array("%%TITLE%%" => $title));
echo $this->html->getReplacedHTMLRepeatedBlockByModelObject(array("product" => $product, "category" => $category), Functions::getPublicFileURL("pages/" . $page . ".html"), "getReplaceChars");
echo $this->html->getFilteredText(Functions::getPublicFile("includes/footer.html"));
开发者ID:youssefbenhssaien,项目名称:MVC-PHP,代码行数:31,代码来源:product.php


注:本文中的Functions::getPublicFileURL方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。