本文整理汇总了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');
}
}
示例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);*/
示例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();
});