當前位置: 首頁>>代碼示例>>PHP>>正文


PHP HomeController::process方法代碼示例

本文整理匯總了PHP中HomeController::process方法的典型用法代碼示例。如果您正苦於以下問題:PHP HomeController::process方法的具體用法?PHP HomeController::process怎麽用?PHP HomeController::process使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在HomeController的用法示例。


在下文中一共展示了HomeController::process方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: HomeController

<?php

require_once 'config.php';
require_once 'Controllers/HomeController.php';
require_once 'libs/Database/Database.php';
require_once 'libs/utils/utils.php';
$action = $_REQUEST['action'];
if (!empty($action)) {
    require_once 'Controllers/' . $action . 'Controller.php';
    $actionController = $action . 'Controller';
    $instance = new $actionController($_REQUEST);
    $instance->process();
} else {
    $_REQUEST['action'] = 'Home';
    $instance = new HomeController($_REQUEST);
    $instance->process();
}
開發者ID:sukruthmk,項目名稱:travel-hack,代碼行數:17,代碼來源:index.php

示例2: Registry

////ALWAYS SET THIS TO 'FALSE' BEFORE DEPLOYING
/** AutoLoad class files as soon as needed ***/
spl_autoload_register('loadClass');
include_once CONFIG . 'settings.php';
$registry = new Registry();
Factory::getRegistry($registry);
Factory::getParameters($parameters);
//parameter is defined in the settings file
// URI will always be of the form /specific_path
$request = $_SERVER["REQUEST_URI"];
$path = explode("/", $request);
$controller_obj = null;
switch ($path[1]) {
    case '':
        $controller_obj = new HomeController($path, $registry);
        $controller_obj->process($_POST);
        break;
    case 'admin':
        $controller_obj = new AdminController($path, $registry);
        $controller_obj->process($_POST);
        break;
    case 'categories':
        $controller_obj = new CategoriesController($path, $registry);
        $controller_obj->process($_POST);
        break;
    case 'contact':
        break;
    case 'profile':
        $controller_obj = new ProfileController($path, $registry);
        $controller_obj->process($_POST);
        break;
開發者ID:General-ZOD,項目名稱:eduvideo,代碼行數:31,代碼來源:index.php


注:本文中的HomeController::process方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。