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


PHP PageController::renderTemplateWithData方法代碼示例

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


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

示例1: function

<?php

$router->with('/', function () use($router) {
    $router->respond('GET', '', function ($request, $response) {
        require_once $_SERVER['DOCUMENT_ROOT'] . '/routes/page.controller.php';
        $page_controller = new PageController();
        $page = $page_controller->renderTemplateWithData('/templates/home/home.mustache', null);
        echo $page;
    });
});
開發者ID:zachlite,項目名稱:clan-web,代碼行數:10,代碼來源:home.router.php

示例2: PageController

     require_once $_SERVER['DOCUMENT_ROOT'] . '/routes/page.controller.php';
     $page_controller = new PageController();
     $page = $page_controller->renderTemplateWithData('/templates/account/create_account.mustache', null);
     echo $page;
 });
 $router->respond('GET', '/get-username', function () {
     require_once $_SERVER['DOCUMENT_ROOT'] . '/routes/page.controller.php';
     $page_controller = new PageController();
     $page = $page_controller->renderTemplateWithData('/templates/account/get_username.mustache', null);
     echo $page;
 });
 $router->respond('GET', '/reset-password', function () {
     $data['show_form'] = isset($_GET['v']) ? 1 : 0;
     require_once $_SERVER['DOCUMENT_ROOT'] . '/routes/page.controller.php';
     $page_controller = new PageController();
     $page = $page_controller->renderTemplateWithData('/templates/account/reset_password.mustache', $data);
     echo $page;
 });
 //////////////////////////////////////////////////////////////
 //POST
 $router->respond('POST', '/new', function () {
     require_once __DIR__ . '/account.controller.php';
     $account_controller = new AccountController();
     $user_name = $_POST['data']['username'];
     $email = $_POST['data']['email'];
     $password = $_POST['data']['password'];
     $account_controller->createAccount($user_name, $email, $password);
 });
 $router->respond('POST', '/get-username', function () {
 });
 $router->respond('POST', '/reset-password', function () {
開發者ID:zachlite,項目名稱:clan-web,代碼行數:31,代碼來源:account.router.php


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