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


PHP DefaultController::index方法代碼示例

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


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

示例1: __construct

 public function __construct()
 {
     $this->splitUrl();
     if (!$this->url_controller) {
         require APP . 'controller/DefaultController.php';
         $page = new DefaultController();
         $page->index();
     } elseif (file_exists(APP . 'controller/' . ucfirst($this->url_controller) . 'Controller.php')) {
         $this->url_controller = ucfirst($this->url_controller) . 'Controller';
         require APP . 'controller/' . $this->url_controller . '.php';
         $this->url_controller = new $this->url_controller();
         if (method_exists($this->url_controller, $this->url_action)) {
             if (!empty($this->url_params)) {
                 call_user_func_array(array($this->url_controller, $this->url_action), $this->url_params);
             } else {
                 $this->url_controller->{$this->url_action}();
             }
         } else {
             if (strlen($this->url_action) == 0) {
                 $this->url_controller->index();
             } else {
                 header('location: ' . URL . 'error');
             }
         }
     } else {
         header('location: ' . URL . 'error');
     }
 }
開發者ID:robStack,項目名稱:prototype-mvc,代碼行數:28,代碼來源:App.php

示例2: index

<?php

class DefaultController extends adapterUi
{
    function index()
    {
        $tplDir = $this->cmsdata['head']['tplDir'];
        header("Content-type:text/html;charset=UTF-8");
        if (!empty($this->cmsdata['head']['forceCompile'])) {
            $smarty->force_compile = true;
        }
        $this->smarty->display($tplDir);
    }
}
$controller = new DefaultController();
$controller->index();
/*$sysData['templateRoot'] = $smarty->getTemplateDir(0)."/";
if(isset($_GET['debug'])){
    if($_GET['debug'] == 'on'){
        $smarty->debugging = true;
    }
}*/
/*if( !empty( $rootData['head']['forceCompile'] ) ){
    $smarty->force_compile = true;
}
$smarty->assign('root',$rootData);
$smarty->assign('sysInfo',$sysData);

$smarty->display($tplDir);*/
開發者ID:yaoboqin,項目名稱:fis3,代碼行數:29,代碼來源:BaseController.php

示例3: check_logged_in

<?php

function check_logged_in()
{
    BaseController::check_logged_in();
}
function check_if_admin()
{
    BaseController::check_if_admin();
}
$routes->get('/', function () {
    DefaultController::index();
});
$routes->get('/info', function () {
    DefaultController::info();
});
$routes->post('/ostoskori/:id/lisaa', function ($id) {
    CartController::add($id);
});
$routes->post('/ostoskori/:id/poista', function ($id) {
    CartController::delete($id);
});
$routes->post('/ostoskori/tyhjenna', function () {
    CartController::deleteAll();
});
$routes->get('/kassa', function () {
    OrdersController::add_form();
});
$routes->post('/kassa', function () {
    OrdersController::add();
});
開發者ID:nadeka,項目名稱:pizzataivas,代碼行數:31,代碼來源:routes.php


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