当前位置: 首页>>代码示例>>PHP>>正文


PHP AppController::render方法代码示例

本文整理汇总了PHP中AppController::render方法的典型用法代码示例。如果您正苦于以下问题:PHP AppController::render方法的具体用法?PHP AppController::render怎么用?PHP AppController::render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AppController的用法示例。


在下文中一共展示了AppController::render方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: render

 public static function render($params = [])
 {
     isset($_POST['idStructure']) ? $idStructure = $_POST['idStructure'] : ($idStructure = '');
     isset($_POST['structure']) ? $structure = $_POST['structure'] : ($structure = '');
     isset($_POST['translationToC']) ? $translationToC = $_POST['translationToC'] : ($translationToC = '');
     isset($_POST['translationToJava']) ? $translationToJava = $_POST['translationToJava'] : ($translationToJava = '');
     isset($_POST['translationToJavascript']) ? $translationToJavascript = $_POST['translationToJavascript'] : ($translationToJavascript = '');
     isset($_POST['translationToPython']) ? $translationToPython = $_POST['translationToPython'] : ($translationToPython = '');
     isset($_POST['translationToPhp']) ? $translationToPhp = $_POST['translationToPhp'] : ($translationToPhp = '');
     isset($_POST['pseudoCodeToTest']) ? $pseudoCodeToTest = $_POST['pseudoCodeToTest'] : ($pseudoCodeToTest = '');
     isset($_POST['test']) ? $hadToTranslate = true : ($hadToTranslate = false);
     $user = AppController::getUser();
     if (!$user) {
         AppController::setMsg("warning", "Vous devez être connecté pour avoir accès à cette partie du site");
         AppController::redirect('index');
     }
     if (isset($_POST['erase'])) {
         unset($_POST['erase']);
         self::erase();
         die;
     }
     if (isset($_POST['save'])) {
         unset($_POST['save']);
         self::save(['idStructure' => $idStructure]);
         die;
     }
     parent::render(['idStructure' => $idStructure, 'structure' => $structure, 'pseudoCodeToTest' => $pseudoCodeToTest, 'translationToC' => $translationToC, 'translationToJava' => $translationToJava, 'translationToJavascript' => $translationToJavascript, 'translationToPhp' => $translationToPhp, 'translationToPython' => $translationToPython, 'hadToTranslate' => $hadToTranslate]);
 }
开发者ID:rloic,项目名称:ptut,代码行数:28,代码来源:StructureController.php

示例2: render

 function render($action = NULL, $layout = NULL, $file = NULL)
 {
     if ($action == null) {
         $action = $this->view_action;
     }
     $output = parent::render($action, $layout, $file);
     return $output;
 }
开发者ID:areisv,项目名称:cakewell,代码行数:8,代码来源:journal_controller.php

示例3: render

 /**
  * Fonction de rendu par défaut
  * @param type $params
  */
 public static function render($params = [])
 {
     $user = AppController::getUser();
     if (!$user) {
         AppController::setMsg("warning", "Vous devez être connecté pour avoir accès à cette zone.");
         AppController::redirect("index");
     }
     if (isset($_POST['action'])) {
         self::update();
         $user = AppController::getUser();
     }
     parent::render(['id' => $user->getId(), 'name' => $user->getName(), 'email' => $user->getEmail(), 'avatar' => $user->getAvatar()]);
 }
开发者ID:rloic,项目名称:ptut,代码行数:17,代码来源:AccountController.php

示例4: render

 public static function render($params = [])
 {
     $helpList = \Root\Src\Model\AlgorithmModel::getMostRecentHelped();
     $helpMsg = [];
     foreach ($helpList as $help) {
         $userId = \Root\Src\Model\MailModel::getMsgBySubject($help->getId())[0]->getOwnerId();
         $helpMsg[$help->getId()]["owner"] = \Root\Src\Model\UserModel::getUser($userId)->getName();
         $helpMsg[$help->getId()]["content"] = \Root\Src\Model\MailModel::getMsgBySubject($help->getId())[0]->getContent();
     }
     $news = [];
     $sharing = [];
     parent::render(["helpList" => $helpList, "helpMsg" => $helpMsg, "news" => $news, "sharing" => $sharing]);
 }
开发者ID:rloic,项目名称:ptut,代码行数:13,代码来源:IndexController.php

示例5: renderFile

 protected function renderFile(\AppController $class)
 {
     $class->render(array('controller' => 'Usuarios', 'view' => 'administrador'), 'painel');
 }
开发者ID:brunoblauzius,项目名称:sistema,代码行数:4,代码来源:PainelAdmin.php

示例6: getenv

<?php

/**
 * Yeah. You're definitely going to need this.
 * Probably don't edit anything in here.
 */
require getenv('DOCUMENT_ROOT') . '/app/bootstrap.php';
/**
 * And ah... don't forget to actually run the application.
 */
try {
    BadKitty::getInstance()->dispatch();
} catch (Exception $e) {
    $klass = new AppController();
    $klass->e = $e;
    if (__DEBUG__ == TRUE) {
        $klass->title = 'Error';
        echo $klass->render('error.php');
    } else {
        $klass->title = '404 Not Found';
        echo $klass->render('error404.php');
    }
}
开发者ID:paularmstrong,项目名称:badkitty,代码行数:23,代码来源:index.php

示例7: confirmAccount

 /**
  * Méthode de confirmation d'un compte utilisateur
  * @param type $params
  */
 public static function confirmAccount($params = [])
 {
     $id = null;
     $confirmToken = null;
     if (isset($params[0]) && isset($params[1])) {
         $id = $params[0];
         $confirmToken = $params[1];
     }
     $user = new \Root\Src\Model\UserModel('', '');
     $user->setId($id);
     $user->setConfirmToken($confirmToken);
     $validAccount = $user->activate();
     if ($validAccount) {
         AppController::setMsg("success", "Votre compte a bien été validé.");
         AppController::setMsg("success", "Votre êtes maintenant connecté.");
         AppController::setUser($validAccount);
     } else {
         AppController::setMsg("warning", "Information du compte non valide.");
     }
     AppController::render();
 }
开发者ID:rloic,项目名称:ptut,代码行数:25,代码来源:ConnectionController.php

示例8: render

 public static function render($params = [])
 {
     $method = false;
     $activeFunction = false;
     if (isset($_POST['translate'])) {
         $method = 'translate';
     }
     if (isset($_POST['new'])) {
         $method = 'erase';
     }
     if (isset($_POST['open'])) {
         $method = 'open';
     }
     if (isset($_POST['save'])) {
         $method = 'save';
     }
     if (isset($_POST['backup'])) {
         $method = 'backup';
     }
     if (isset($_POST['share'])) {
         $method = 'share';
     }
     if (isset($_POST['askForHelp'])) {
         $method = 'askForHelp';
     }
     if ($method) {
         self::$method();
         die;
     }
     $id = NULL;
     $pseudoCode = '';
     if (isset($params[0])) {
         $id = $params[0];
     }
     $language = 'php';
     $user = AppController::getUser();
     $privateFunctions = [];
     $userStructures = [];
     $selectedUserStructures = [];
     if (isset($_POST['selectedStructures'])) {
         $selectedUserStructures = $_POST['selectedStructures'];
     } else {
         if ($user) {
             $structures = \Root\Src\Model\StructureModel::loadStructureByUser($user->getId());
             foreach ($structures as $structure) {
                 array_push($selectedUserStructures, $structure->getId());
             }
         }
     }
     if (isset($_POST['id'])) {
         $id = $_POST['id'];
     }
     if ($user) {
         $privateFunctions = \Root\Src\Model\AlgorithmModel::loadFunctionByUser($user->getId());
         $userStructures = \Root\Src\Model\StructureModel::loadStructureByUser($user->getId());
         if ($id) {
             $function = \Root\Src\Model\AlgorithmModel::loadFunctionById($id);
             if ($function) {
                 if ($function->getOwnerId() != $user->getId()) {
                     $pseudoCode = '';
                     $id = '';
                     $_POST['id'] = NULL;
                 } else {
                     if ($pseudoCode == "") {
                         $pseudoCode = $function->getContent();
                         $activeFunction = $function;
                     }
                 }
             }
         }
     }
     $publicFunctions = [];
     $allPublicFunctions = \Root\Src\Model\AlgorithmModel::loadPublicFunction();
     foreach ($allPublicFunctions as $currentFunction) {
         if (!in_array($currentFunction, $privateFunctions)) {
             array_push($publicFunctions, $currentFunction);
         }
     }
     $selectedPrivateFunctions = [];
     if (isset($_POST['privateFunctions'])) {
         $selectedPrivateFunctions = $_POST['privateFunctions'];
     }
     $selectedPublicFunctions = [];
     if (isset($_POST['publicFunctions'])) {
         $selectedPublicFunctions = $_POST['publicFunctions'];
     }
     if (isset($_POST['language'])) {
         $language = $_POST['language'];
     }
     if (isset($_POST['pseudoCode'])) {
         $pseudoCode = $_POST['pseudoCode'];
     }
     $helpMsgs = \Root\Src\Model\MailModel::getMsgBySubject($id);
     parent::render(['id' => $id, 'selectedLanguage' => $language, 'pseudoCode' => $pseudoCode, 'user' => $user, 'privateFunctions' => $privateFunctions, 'publicFunctions' => $publicFunctions, 'selectedPrivateFunctions' => $selectedPrivateFunctions, 'selectedPublicFunctions' => $selectedPublicFunctions, 'userStructures' => $userStructures, 'selectedUserStructures' => $selectedUserStructures, 'activeFunction' => $activeFunction, 'helpMsgs' => $helpMsgs]);
 }
开发者ID:berseker10000,项目名称:ptut,代码行数:95,代码来源:CodeController.php

示例9: error

 public function error($method = NULL)
 {
     header('HTTP/1.0 404 Not Found');
     if (__DEBUG__) {
         throw new Exception($this->url . ' Not Found');
     } else {
         $klass = new AppController();
         $klass->url = '/' . $this->url;
         $klass->url = '404 Not Found';
         echo $klass->render('error404.php');
     }
 }
开发者ID:paularmstrong,项目名称:badkitty,代码行数:12,代码来源:BadKitty.php

示例10: AppController

    $app_controller = new AppController();
} catch (Exception $e) {
    exit($e->getMessage());
}
?>

<!DOCTYPE html>
<html ng-app="myApp">
	<head>
		<title></title>
		<link rel="stylesheet" type="text/css" href="assets/css/normalize.css">
		<link rel="stylesheet" type="text/css" href="assets/css/app/animate.css">
		<link rel="stylesheet" type="text/css" href="assets/css/app/main.css">
	</head>
	<body>
		<header></header>
		<div id="container_id"></div>
		<a href="https://github.com/aj07mm/shellmanager" target="_blank"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"></a>
		<?php 
$app_controller->render('index', array('model' => $model));
//TODO assumindo que getAllScripts() foi chamada
$app_controller->render('footer', array('totalScripts' => $model->getQuantityValidScripts()));
?>
	<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.18/angular.min.js"></script>
	<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.18/angular-animate.min.js"></script>
	<script type="text/javascript" src="assets/js/app/main.js"></script>
	<script type="text/javascript" src="config.json"></script>
</body>
</html>

开发者ID:cinno,项目名称:shellManager,代码行数:29,代码来源:index.php


注:本文中的AppController::render方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。