本文整理汇总了PHP中UserController::render方法的典型用法代码示例。如果您正苦于以下问题:PHP UserController::render方法的具体用法?PHP UserController::render怎么用?PHP UserController::render使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserController
的用法示例。
在下文中一共展示了UserController::render方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
static function run()
{
$r = new Request();
$r->parse();
$controller = $r->controller . 'Controller';
$action = $r->action;
if (class_exists($controller)) {
$obj = new $controller($r);
$obj->render();
} else {
// do default stuff;
$obj = new UserController(new Request());
$obj->render();
}
}
示例2: UserController
$serviceController->render();
break;
}
break;
case "users":
$userController = new UserController();
$where = $route[2];
switch ($where) {
case 'addNew':
$userController->addNew();
break;
case 'updateRequestStatus':
$userController->updateUser();
break;
default:
$userController->render();
break;
}
break;
case "getInTouch":
$getInTouchController = new GetInTouchController();
$where = $route[2];
switch ($where) {
case 'updateGetInTouchStatus':
$getInTouchController->updateGetInTouchStatus();
break;
default:
$getInTouchController->render();
break;
}
break;
示例3: userController_markTroll_create
/**
* Validates the current user's permissions & transientkey and then marks a user as a troll.
*
* @param UserController $sender
*/
public function userController_markTroll_create($sender, $userID, $troll = true)
{
$sender->permission('Garden.Moderation.Manage');
$trollUserID = $userID;
// Validate the transient key && permissions
// Make sure we are posting back.
if (!$sender->Request->isAuthenticatedPostBack()) {
throw PermissionException('Javascript');
}
$trolls = self::getTrolls();
// Toggle troll value in DB
if (in_array($trollUserID, $trolls)) {
Gdn::sql()->update('User', ['Troll' => 0], ['UserID' => $trollUserID])->put();
unset($trolls[array_search($trollUserID, $trolls)]);
} else {
Gdn::sql()->update('User', ['Troll' => 1], ['UserID' => $trollUserID])->put();
$trolls[] = $trollUserID;
}
self::setTrolls($trolls);
$sender->jsonTarget('', '', 'Refresh');
$sender->render('Blank', 'Utility', 'Dashboard');
}
示例4: catch
require ROOT_DIR . '/appli/engine/model/AppModel.php';
require ROOT_DIR . '/appli/engine/model/Manager.php';
// Services
require ROOT_DIR . '/appli/engine/service/Service.php';
require ROOT_DIR . '/appli/engine/service/Container.php';
// Controllers
require ROOT_DIR . '/appli/engine/controller/Controller.php';
require ROOT_DIR . '/appli/engine/controller/AppController.php';
// Classes propres au site
require ROOT_DIR . '/appli/models/User.php';
require ROOT_DIR . '/appli/models/Link.php';
require ROOT_DIR . '/appli/views/ViewHelper.php';
// gestionnaire d'erreurs
include ROOT_DIR . '/appli/engine/ErrorHandler.php';
set_error_handler("ErrorHandler");
try {
require_once ROOT_DIR . '/appli/controllers/' . $page . '.php';
$controller = new $page();
$controller->{$action}();
} catch (Exception $e) {
Service_Container::getInstance()->get('Mailer')->sendError($e);
if ($page == 'UserController') {
include ROOT_DIR . '/appli/views/maintenance.htm';
die;
} else {
require_once ROOT_DIR . '/appli/controllers/UserController.php';
$controller = new UserController();
$controller->view->growlerError();
$controller->render();
}
}