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


PHP Twig_Environment::display方法代码示例

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


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

示例1: display

 /**
  * @see IRenderEngine::display()
  */
 function display($template)
 {
     if (strpos('.', $template) === false) {
         $template .= '.html';
     }
     return $this->twig->display($template, $this->assignments);
 }
开发者ID:hpazevedo,项目名称:Teste-BDR,代码行数:10,代码来源:TwigRenderEngine.php

示例2: display

 /**
  * Display a template for provided handle.
  *
  * The template will be loaded and compiled, if necessary, first.
  *
  * This function calls hooks.
  *
  * @param string $handle Handle to display
  * @return \phpbb\template\template $this
  */
 public function display($handle)
 {
     $result = $this->call_hook($handle, __FUNCTION__);
     if ($result !== false) {
         return $result[0];
     }
     $this->twig->display($this->get_filename_from_handle($handle), $this->get_template_vars());
     return $this;
 }
开发者ID:007durgesh219,项目名称:phpbb,代码行数:19,代码来源:twig.php

示例3: display

 public function display($template, $data = [], $config = [])
 {
     if ($config) {
         $this->config($config);
     }
     $key = md5($template);
     $loader = new \Twig_Loader_Array([$key => $template]);
     $twig = new \Twig_Environment($loader, ['debug' => APP_DEBUG, 'auto_reload' => true, 'cache' => $this->config['cache_path']]);
     $twig->display($key, $data);
 }
开发者ID:yunwuxin,项目名称:think-twig,代码行数:10,代码来源:Twig.php

示例4: renderPaymentScripts

 /**
  * Render banwire scripts view
  */
 public function renderPaymentScripts()
 {
     $this->environment->display('BanwireBundle:Banwire:scripts.html.twig', array('currency' => $this->paymentBridgeInterface->getCurrency()));
 }
开发者ID:hason,项目名称:paymentsuite,代码行数:7,代码来源:BanwireExtension.php

示例5: display

 /**
  * {@inheritdoc}
  */
 public function display($name, array $context = [])
 {
     $level = ob_get_level();
     ob_start();
     try {
         parent::display($name, $context);
     } catch (\Exception $e) {
         while (ob_get_level() > $level) {
             ob_end_clean();
         }
         throw $e;
     }
     $output = ob_get_clean();
     echo $this->inject_assets($output);
 }
开发者ID:Mtechnik,项目名称:phpbb,代码行数:18,代码来源:environment.php

示例6: array

<?php

declare (encoding='UTF-8');
require_once 'Twig/Autoloader.php';
Twig_Autoloader::register();
$loader = new Twig_Loader_Filesystem('templates');
$twig = new Twig_Environment($loader);
require_once "SizePrice.php";
require_once "Item.php";
require_once "config.php";
$twig->display('index.html', array("items" => $items));
开发者ID:raphaelm,项目名称:rzl_merchandise,代码行数:11,代码来源:index.php

示例7: renderPaymentView

 /**
  * Render redsys api form view
  *
  * @param string $viewTemplate An optional template to render.
  *
  * @return string view html
  */
 public function renderPaymentView($viewTemplate = null)
 {
     $formType = $this->formFactory->create('redsys_api_type');
     $this->environment->display($viewTemplate ?: $this->viewTemplate, array('redsys_api_form' => $formType->createView(), 'redsys_api_execute_route' => RedsysApiRoutesLoader::ROUTE_NAME));
 }
开发者ID:atresmediahf,项目名称:paymentsuite,代码行数:12,代码来源:RedsysApiExtension.php

示例8: display

 /**
  * display the template
  * @param string $template template name
  * @param bool $defaultExtension if to use the default template engine's file extension for template files
  * @return ITemplateEngine
  */
 public function display($template, $defaultExtension = false)
 {
     $this->twigEnv->display($template . ($defaultExtension ? self::DEFAULT_EXTENSION : ''), $this->variables);
     return $this;
 }
开发者ID:aelix,项目名称:framework,代码行数:11,代码来源:TwigTemplateEngine.php

示例9: function

<?php

error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once __DIR__ . '/vendor/autoload.php';
$loader = new Twig_Loader_Filesystem(__DIR__ . '/templates');
$twig = new Twig_Environment($loader);
$twig->addFunction(new \Twig_SimpleFunction('asset', function ($asset) {
    return '/build/' . ltrim($asset, '/');
}));
$uriParts = explode('?', $_SERVER['REQUEST_URI']);
$templatePath = $uriParts[0] . (substr($uriParts[0], -1, 1) === '/' ? 'index' : '');
try {
    $twig->display("pages{$templatePath}.html.twig");
} catch (Twig_Error_Loader $e) {
    header('HTTP/1.0 404 Not Found');
    $twig->display('errors/404.html.twig');
} catch (RuntimeException $e) {
    $twig->display('errors/runtime.html.twig', array('error' => $e));
}
开发者ID:vudaltsov,项目名称:frontend-project,代码行数:20,代码来源:index.php

示例10: renderPaymentScripts

 /**
  * Render stripe scripts view
  *
  * @return string js code needed by Stripe behaviour
  */
 public function renderPaymentScripts()
 {
     return $this->environment->display($this->scriptsTemplate, array('public_key' => $this->publicKey, 'currency' => $this->paymentBridgeInterface->getCurrency()));
 }
开发者ID:hason,项目名称:paymentsuite,代码行数:9,代码来源:StripeExtension.php

示例11: render

 /**
  * Extended view, for detailed representation
  */
 public function render(\Twig_Environment $env, array $params)
 {
     $params = array_merge(array('date' => $this), $params);
     $env->display("@values/date.twig", $params);
 }
开发者ID:samuvack,项目名称:admin,代码行数:8,代码来源:DateValue.php

示例12: display

 public function display($name, array $context = array())
 {
     return parent::display($name, $this->transformContext($context));
 }
开发者ID:renegare,项目名称:skip_php_framework,代码行数:4,代码来源:TwigService.php

示例13: explode

$action = explode('/', substr($query, 1));
if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest') {
    //JSON
    if ($_SERVER['REQUEST_URI'] = '/getEvents') {
        $events = $_POST['events'];
        if (count($events) > 0) {
            $events = implode(',', $events);
            echo json_encode(Fetch($config['query']['getEventsByIDs'], ['ids' => $events]));
        }
    }
} else {
    if ($action[0] == 'card') {
        //=============================card=============================
        if (isset($action[1])) {
            $res = Fetch($config['query']['getEventsByNumber'], ['number' => $action[1]]);
            $twig->display('log_detail.twig', array('cards' => $res, 'env' => $env));
        } else {
            $res = Fetch($config['query']['getSplash'][$env['db']['alias']], ['limit' => 500]);
            $twig->display('card.twig', array('cards' => $res, 'env' => $env));
        }
    } elseif ($action[0] == 'test') {
        //=============================test=============================
        echo "<pre>" . print_r($config, true) . "</pre>>";
    } elseif ($action[0] == 'db') {
        //=============================db=============================
        if (isset($config['dbs'][$action[1]])) {
            $_SESSION['db'] = $config['dbs'][$action[1]];
            $url = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/';
            header('Location: ' . $url);
        } else {
            header("HTTP/1.0 500 Internal Server Error ");
开发者ID:qwexak,项目名称:parking-web,代码行数:31,代码来源:index.php

示例14: render

 /**
  * Extended view, for detailed representation
  */
 public function render(\Twig_Environment $env, array $params)
 {
     $params = array_merge(array('text' => $this, 'plain' => false), $params);
     $env->display("@values/text.twig", $params);
 }
开发者ID:samuvack,项目名称:admin,代码行数:8,代码来源:TextValue.php

示例15: array

<?php

ini_set('display_errors', 1);
error_reporting(E_ALL ^ E_NOTICE);
require_once '../vendor/autoload.php';
// Twig инициализация
$loader = new Twig_Loader_Filesystem('../templates');
// Twig папка с шаблонами
//$twig = new Twig_Environment($loader, array('cache' => 'cache',));
$twig = new Twig_Environment($loader, array('cache' => '', 'trim_blocks' => true));
echo $twig->display(basename(__DIR__) . '.twig', array('admin_fio' => 'Калиничев Владимир', 'section' => basename(__DIR__), 'sections' => array('' => 'Home', 'bills' => 'Счета', 'users' => 'Пользователи', 'supply' => 'Расходники')));
开发者ID:progervlad,项目名称:utils,代码行数:11,代码来源:index.php


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