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


PHP Slim::render方法代码示例

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


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

示例1: get

 public function get($msg = null)
 {
     $data = [];
     if (!is_null($msg)) {
         $data['message'] = $msg;
     }
     $this->slim->render('login.twig', $data);
 }
开发者ID:etu,项目名称:0bRSS,代码行数:8,代码来源:Login.php

示例2: render

 protected function render($template, $data = array(), $status = null)
 {
     try {
         $this->application->render($template, $data, $status);
     } catch (Twig_Error_Runtime $e) {
         $this->application->render('Error/app_load_error.html.twig', array('message' => sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, null, $e));
     }
 }
开发者ID:asgrim,项目名称:joindin-web2,代码行数:8,代码来源:BaseController.php

示例3: registrationRoute

 public static function registrationRoute(\Slim\Slim $app)
 {
     $app->get('/', function () use($app) {
         $app->render('index.php');
     });
     $app->post('/form/', function () use($app) {
         $app->render('index.php', ['nickname' => $_POST['nickname']]);
     });
 }
开发者ID:h-inuzuka,项目名称:quiz,代码行数:9,代码来源:Route.php

示例4: delete

 public function delete($key)
 {
     $config = new Config();
     if ($config->readKey($key)) {
         $id = $config->id;
         $this->app->render($config->delete() ? 200 : 500, ['response' => $id]);
     } else {
         $this->app->render(404);
     }
 }
开发者ID:nextglory,项目名称:CacoCloud,代码行数:10,代码来源:REST.php

示例5: getFeedItemsAtom

 /**
  * GET /export/feed/:id/atom
  *
  * @param int $id
  */
 public function getFeedItemsAtom($id)
 {
     $feed = new Feed();
     if (!$feed->read($id)) {
         $this->app->render(404);
         return;
     }
     $items = (new Item())->readList('id_feed = ?', [$feed->id]);
     $this->xmlOutput(new Atom($feed, $items));
 }
开发者ID:nextglory,项目名称:CacoCloud,代码行数:15,代码来源:REST.php

示例6: render

 protected function render($template, $data = array(), $status = array())
 {
     try {
         $this->app->render($template, $data, $status);
     } catch (Twig_Error_Runtime $twigException) {
         $errorData = array();
         $errorData['errorMessage'] = sprintf("An error was thrown while rendering view template from class %s. (%s)", get_class($this), $twigException->getMessage());
         if ($this->app->getMode() == self::DEV_MODE) {
             $errorData['stackTrace'] = $twigException->getTraceAsString();
         }
         $this->app->render(self::ERROR_TEMPLATE, $errorData, self::ERROR_CODE);
     }
 }
开发者ID:sjzurek,项目名称:slim-fast,代码行数:13,代码来源:Base.php

示例7: cleanupOldFiles

 public function cleanupOldFiles()
 {
     $_SESSION['DB_DONE'] = true;
     $cleanupList = array_merge($this->pluginFinder->getDummyPlugins(), $this->filesFinder->getCleanupFiles());
     $this->cleanupMedia();
     if (count($cleanupList) == 0) {
         $_SESSION['CLEANUP_DONE'] = true;
         $this->response->redirect($this->app->urlFor('done'));
     }
     if ($this->request->isPost()) {
         $result = [];
         foreach ($cleanupList as $path) {
             $result = array_merge($result, Utils::cleanPath($path));
         }
         if (count($result) == 0) {
             $_SESSION['CLEANUP_DONE'] = true;
             $this->response->redirect($this->app->urlFor('done'));
         } else {
             $result = array_map(function ($path) {
                 return substr($path, strlen(SW_PATH) + 1);
             }, $result);
             $this->app->render('cleanup.php', ['cleanupList' => $result, 'error' => true]);
         }
     } else {
         $cleanupList = array_map(function ($path) {
             return substr($path, strlen(SW_PATH) + 1);
         }, $cleanupList);
         $this->app->render('cleanup.php', ['cleanupList' => $cleanupList, 'error' => false]);
     }
 }
开发者ID:GerDner,项目名称:luck-docker,代码行数:30,代码来源:CleanupController.php

示例8: render

 /**
  * Override \Slim\Slim::render method on controller
  *
  * @param string $tpl
  * @param array $data []
  * @param string $suffix
  * @return void
  */
 protected function render($tpl, array $data = [])
 {
     $suffix = $this->app->config('template.suffix');
     $suffix = empty($suffix) ? $this->viewSuffix : $suffix;
     $tpl .= $suffix;
     $this->app->render($tpl, $data);
 }
开发者ID:im286er,项目名称:slimore,代码行数:15,代码来源:Controller.php

示例9: render

 public function render($name, $data = array(), $status = null)
 {
     if (strpos($name, ".php") === false) {
         $name = $name . ".php";
     }
     parent::render($name, $data, $status);
 }
开发者ID:NicolasVillalba,项目名称:Slim-MVC,代码行数:7,代码来源:Controller.php

示例10: printMenu

 /**
  *
  */
 public function printMenu()
 {
     $result = [];
     $complete = true;
     $entries = $this->entries;
     foreach ($entries as $entry) {
         $active = $entry == current($this->entries);
         if ($active) {
             $complete = false;
         }
         $key = 'menuitem_' . $entry;
         $label = $this->translations->translate($key);
         $result[] = ['label' => $label, 'complete' => $complete, 'active' => $active];
     }
     $this->slim->render('/_menu.php', ['entries' => $result]);
 }
开发者ID:GerDner,项目名称:luck-docker,代码行数:19,代码来源:MenuHelper.php

示例11: action_quickAddDialog

 /**
  * Returns the form HTML to create a new setup.
  * @param Slim $app
  */
 public function action_quickAddDialog(Slim $app)
 {
     if (!$app->user->isLoggedin()) {
         return false;
     }
     $tour = $app->rulechecker->getTournament();
     $app->render('setup/quickAddDialog.twig', array('tournament' => $tour));
 }
开发者ID:Covert-Inferno,项目名称:eveATcheck,代码行数:12,代码来源:setup.php

示例12: __invoke

 /**
  * Call this class as a function.
  *
  * @return void
  */
 public function __invoke()
 {
     $request = MessageBridge::newOAuth2Request($this->slim->request());
     $response = new OAuth2\Response();
     $isValid = $this->server->validateAuthorizeRequest($request, $response);
     if (!$isValid) {
         MessageBridge::mapResponse($response, $this->slim->response());
         return;
     }
     $authorized = $this->slim->request()->params('authorized');
     if (empty($authorized)) {
         $this->slim->render($this->template, ['client_id' => $request->query('client_id', false)]);
         return;
     }
     //@TODO implement user_id
     $this->server->handleAuthorizeRequest($request, $response, $authorized === 'yes');
     MessageBridge::mapResponse($response, $this->slim->response());
 }
开发者ID:tularamaurya,项目名称:slim-oauth2-routes,代码行数:23,代码来源:Authorize.php

示例13: action_exportDialog

 public function action_exportDialog(Slim $app, $setupId, $fitId)
 {
     if (!$app->user->isLoggedin()) {
         return false;
     }
     $setup = $app->evefit->getSetup($setupId);
     $fit = $setup->getFit($fitId);
     $app->render('fit/exportDialog.twig', array('setupId' => $setupId, 'fit' => $fit));
 }
开发者ID:Covert-Inferno,项目名称:eveATcheck,代码行数:9,代码来源:fit.php

示例14: dequeueItem

 /**
  * GET /feed/item/queue
  */
 public function dequeueItem()
 {
     $itemQueue = new ItemQueue();
     if ($itemQueue->dequeue()) {
         $this->getItem($itemQueue->id_item);
     } else {
         $this->app->render(404);
     }
 }
开发者ID:nextglory,项目名称:CacoCloud,代码行数:12,代码来源:REST.php

示例15: action_fitList

 /**
  * Returns partialHTML of a list of fits.
  *
  * @param \Slim\Slim $app
  */
 public function action_fitList(Slim $app, $setupId, $fitId)
 {
     if (!$app->user->isLoggedin()) {
         return false;
     }
     $setup = $app->evefit->getSetup($setupId);
     $fit = $setup->getFit($fitId);
     $tour = $app->rulechecker->getTournament();
     $app->render('fit/fit.twig', array('setup' => $setup, 'fit' => $fit, 'tournament' => $tour));
 }
开发者ID:Covert-Inferno,项目名称:eveATcheck,代码行数:15,代码来源:details.php


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