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


PHP Gdn_Controller::render方法代码示例

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


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

示例1: utilityController_teamworkTaskCompleted_create

 /**
  * Webhook for Teamwork.
  *
  * POST data looks like this:
  * [  'event' => 'TASK.COMPLETED',
  *    'objectId' => '000',
  *    'accountId' => '000',
  *    'userId' => '000',
  * ]
  *
  * @see http://developer.teamwork.com/todolistitems
  *
  * @param Gdn_Controller $sender
  * @param $secret
  * @throws Exception
  */
 public function utilityController_teamworkTaskCompleted_create($sender, $secret)
 {
     if ($secret != c('SprintNotifier.Teamwork.Secret')) {
         throw new Exception('Invalid token.');
     }
     // Get data
     $data = Gdn::request()->post();
     // Sanity check we set up webhooks right.
     if (val('event', $data) != 'TASK.COMPLETED') {
         return;
     }
     // Cheat by storing some data in the config.
     $users = c('SprintNotifier.Teamwork.Users', []);
     $projects = c('SprintNotifier.Teamwork.Projects', []);
     // Get full task data via Teamwork's *ahem* "API".
     $task = self::teamworkTask(val('objectId', $data));
     // DEBUG
     UserModel::setMeta(0, array('TaskAPI' => var_export($task, true)), 'SprintNotifier.Debug.');
     // Respect project whitelist if we're using one.
     if (count($projects) && !in_array($task['project-name'], $projects)) {
         return;
     }
     // Build data for the chat message.
     $teamworkUserID = val('userId', $data);
     $userName = val($teamworkUserID, $users, 'User ' . val('userId', $data));
     $taskUrl = sprintf('https://%1$s.teamwork.com/tasks/%2$s', c('Teamwork.Account'), val('objectId', $data));
     $message = sprintf('%1$s completed %2$s task: <a href="%3$s">%4$s</a>', $userName, strtolower($task['project-name']), $taskUrl, $task['content']);
     // Override HipChat plugin's default token & room.
     saveToConfig('HipChat.Room', c('SprintNotifier.HipChat.RoomID'), false);
     saveToConfig('HipChat.Token', c('SprintNotifier.HipChat.Token'), false);
     // DEBUG
     UserModel::setMeta(0, array('Message' => var_export($message, true)), 'SprintNotifier.Debug.');
     // Say it! Bust it!
     if (class_exists('HipChat')) {
         HipChat::say($message);
     }
     self::bustCache();
     // 200 OK
     $sender->render('blank', 'utility', 'dashboard');
 }
开发者ID:vanilla,项目名称:vanilla-sprint,代码行数:56,代码来源:class.sprintnotifier.plugin.php

示例2: controller_dismiss

 /**
  * Dismiss a flag, then view index.
  * @param Gdn_Controller $Sender
  * @throws Exception
  * @throws Gdn_UserException
  */
 public function controller_dismiss($Sender)
 {
     if (!Gdn::request()->isAuthenticatedPostBack(true)) {
         throw new Exception('Requires POST', 405);
     }
     if (Gdn::session()->checkPermission('Garden.Moderation.Manage')) {
         $Arguments = $Sender->RequestArgs;
         if (sizeof($Arguments) != 2) {
             return;
         }
         list($Controller, $EncodedURL) = $Arguments;
         $URL = base64_decode(str_replace('-', '=', $EncodedURL));
         Gdn::sql()->delete('Flag', array('ForeignURL' => $URL));
         $Sender->informMessage(sprintf(t('%s dismissed.'), t('Flag')));
     }
     $Sender->render('blank', 'utility', 'dashboard');
 }
开发者ID:vanilla,项目名称:vanilla,代码行数:23,代码来源:class.flagging.plugin.php

示例3: settingsController_analyticsTick_create

 /**
  *
  * @param Gdn_Controller $Sender
  */
 public function settingsController_analyticsTick_create($Sender)
 {
     $Sender->deliveryMethod(DELIVERY_METHOD_JSON);
     $Sender->deliveryType(DELIVERY_TYPE_DATA);
     Gdn::statistics()->tick();
     $this->fireEvent("AnalyticsTick");
     $Sender->render();
 }
开发者ID:karanjitsingh,项目名称:iecse-forum,代码行数:12,代码来源:class.statistics.php

示例4: controller_delete

 /**
  * Delete a Tag
  *
  * @param Gdn_Controller $Sender
  */
 public function controller_delete($Sender)
 {
     $Sender->permission('Garden.Settings.Manage');
     $TagID = val(1, $Sender->RequestArgs);
     $TagModel = new TagModel();
     $Tag = $TagModel->getID($TagID, DATASET_TYPE_ARRAY);
     if ($Sender->Form->authenticatedPostBack()) {
         // Delete tag & tag relations.
         $SQL = Gdn::sql();
         $SQL->delete('TagDiscussion', array('TagID' => $TagID));
         $SQL->delete('Tag', array('TagID' => $TagID));
         $Sender->informMessage(formatString(t('<b>{Name}</b> deleted.'), $Tag));
         $Sender->jsonTarget("#Tag_{$Tag['TagID']}", null, 'Remove');
     }
     $Sender->setData('Title', t('Delete Tag'));
     $Sender->render('delete', '', 'plugins/Tagging');
 }
开发者ID:caidongyun,项目名称:vanilla,代码行数:22,代码来源:class.tagging.plugin.php

示例5: homeController_splash_create

 /**
  * Splish splash I was takin' a... modal ad for cloud?
  *
  * @param Gdn_Controller $sender
  */
 public function homeController_splash_create($sender)
 {
     $sender->render('', false, 'vforg');
 }
开发者ID:vanilla,项目名称:community,代码行数:9,代码来源:class.hooks.php


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