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


PHP Twig_Environment::clearCacheFiles方法代码示例

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


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

示例1: render

 public function render($name, array $values = array())
 {
     if (defined('ENV_DEV')) {
         $this->engine->clearCacheFiles();
         $this->engine->clearTemplateCache();
     }
     return $this->engine->render($name . $this->suffix, $values);
 }
开发者ID:php-nik,项目名称:core,代码行数:8,代码来源:TwigProvider.php

示例2: initTemplateEngine

 /**
  * Initialise Twig
  *
  * @return void
  */
 protected function initTemplateEngine()
 {
     $this->loader = new \Twig_Loader_Filesystem($this->getTemplateDir());
     $this->twig = new \Twig_Environment($this->loader, array('cache' => $this->cacheDir));
     if ($this->isDev) {
         $this->twig->clearCacheFiles();
     }
 }
开发者ID:chrisnoden,项目名称:synergy,代码行数:13,代码来源:TwigTemplate.php

示例3: clear_cache

 /**
  * Clear the cache
  *
  * @return \phpbb\template\template
  */
 public function clear_cache()
 {
     if (is_dir($this->cachepath)) {
         $this->twig->clearCacheFiles();
     }
     return $this;
 }
开发者ID:007durgesh219,项目名称:phpbb,代码行数:12,代码来源:twig.php

示例4: render

 /**
  * sends content to the browser
  */
 function render($string, $template_vars = array())
 {
     $loader = new \Twig_Loader_Filesystem($this->templates);
     $twig = new \Twig_Environment($loader, array('cache' => __ROOT__ . '/cache/twig'));
     if (__DEV__) {
         $twig->clearCacheFiles();
     }
     echo $twig->render($string, $template_vars);
 }
开发者ID:pixeledchimp,项目名称:michino,代码行数:12,代码来源:Viewer.php

示例5: getTwig

 /**
  * @param $rootDir
  * @param $loader
  * @return Twig_Environment
  */
 protected function getTwig($rootDir, $loader)
 {
     $twig = new Twig_Environment($loader, array('cache' => $rootDir . '/cache/'));
     $twig->clearCacheFiles();
     $f = new Twig_SimpleFunction("querify", function ($data) {
         $string = array();
         foreach ($data as $d) {
             $string[] = urlencode($d->key) . "=" . urlencode($d->value);
         }
         return implode("&", $string);
     });
     $twig->addFunction("querify", $f);
     $f = new Twig_SimpleFunction("prettify", function ($data) {
         return json_encode(json_decode($data), JSON_PRETTY_PRINT);
     });
     $twig->addFunction("prettify", $f);
     return $twig;
 }
开发者ID:harshitchaudhary,项目名称:docodile,代码行数:23,代码来源:GenerateCommand.php

示例6: Crawler

 */
include_once '../vendor/autoload.php';
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\DomCrawler\Crawler;
use Evista\Perform\Service;
use Evista\Perform\Exception\FormFieldException;
date_default_timezone_set('Europe/Budapest');
$router = new League\Route\RouteCollection();
$loader = new Twig_Loader_Filesystem('../src/views');
$crawler = new Crawler();
// Initialize form transpilation service (dependency injection friendly interface)
$formService = new Service($crawler, '../var/uploads');
$twig = new Twig_Environment($loader, array('cache' => '../var/cache'));
$twig->clearCacheFiles();
$router->addRoute('GET', '/', function (Request $request, Response $response) use($twig) {
    // do something clever
    $response = new Response($twig->render('form.twig.html', []));
    return $response;
});
$router->addRoute('POST', '/displayform', function (Request $request, Response $response) use($twig, $crawler, $formService) {
    $formMarkup = $request->request->get('serform');
    $form = $formService->transpileForm($formMarkup);
    // Dump the object
    $response = new JsonResponse(['dump' => var_export($form, true)]);
    return $response;
});
// Use form data
$router->addRoute('POST', '/multiple-file-uploads', function (Request $request, Response $response) use($twig, $crawler, $formService) {
    $formMarkup = urldecode($request->request->get('serform'));
开发者ID:balintsera,项目名称:evista-perform-example,代码行数:31,代码来源:index.php

示例7: clearCacheFiles

 /**
  * Очистка кеша шаблонов
  */
 public static function clearCacheFiles()
 {
     self::$twigEnvironment->clearCacheFiles();
 }
开发者ID:domackii,项目名称:twigrix,代码行数:7,代码来源:TwigTemplateEngine.php

示例8: clearCacheFiles

 /**
  * [clearCacheFiles description]
  * @return [type] [description]
  */
 public function clearCacheFiles()
 {
     $this->twig->clearCacheFiles();
 }
开发者ID:dalinhuang,项目名称:51mook,代码行数:8,代码来源:TwigAdapter.php

示例9: clearCache

 /**
  * @return void
  */
 public function clearCache()
 {
     $E = new \Twig_Environment(null, array('cache' => realpath(__DIR__ . self::$Cache)));
     $E->clearCacheFiles();
     $E->clearTemplateCache();
 }
开发者ID:BozzaCoon,项目名称:SPHERE-Framework,代码行数:9,代码来源:TwigCache.php

示例10: reset

 /**
  * {@inheritdoc}
  */
 public function reset()
 {
     $this->twig->clearCacheFiles();
     $this->twig->clearTemplateCache();
 }
开发者ID:georgjaehnig,项目名称:sculpin,代码行数:8,代码来源:TwigFormatter.php


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