當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Twig_Environment::disableDebug方法代碼示例

本文整理匯總了PHP中Twig_Environment::disableDebug方法的典型用法代碼示例。如果您正苦於以下問題:PHP Twig_Environment::disableDebug方法的具體用法?PHP Twig_Environment::disableDebug怎麽用?PHP Twig_Environment::disableDebug使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Twig_Environment的用法示例。


在下文中一共展示了Twig_Environment::disableDebug方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testOutput

 public function testOutput()
 {
     $this->fieldDescription->expects($this->any())->method('getTemplate')->will($this->returnValue('SonataAdminBundle:CRUD:base_list_field.html.twig'));
     $this->fieldDescription->expects($this->any())->method('getFieldName')->will($this->returnValue('fd_name'));
     $this->environment->disableDebug();
     $parameters = array('admin' => $this->admin, 'value' => 'foo', 'field_description' => $this->fieldDescription, 'object' => $this->object);
     $template = $this->environment->loadTemplate('SonataAdminBundle:CRUD:base_list_field.html.twig');
     $this->assertSame('<td class="sonata-ba-list-field sonata-ba-list-field-" objectId="12345"> foo </td>', trim(preg_replace('/\\s+/', ' ', $this->twigExtension->output($this->fieldDescription, $template, $parameters))));
     $this->environment->enableDebug();
     $this->assertSame('<!-- START fieldName: fd_name template: SonataAdminBundle:CRUD:base_list_field.html.twig compiled template: SonataAdminBundle:CRUD:base_list_field.html.twig --> <td class="sonata-ba-list-field sonata-ba-list-field-" objectId="12345"> foo </td> <!-- END - fieldName: fd_name -->', trim(preg_replace('/\\s+/', ' ', $this->twigExtension->output($this->fieldDescription, $template, $parameters))));
 }
開發者ID:clavier-souris,項目名稱:SonataAdminBundle,代碼行數:11,代碼來源:SonataAdminExtensionTest.php

示例2: createTwig

 /**
  * Creates a Twig rendering engine
  * @param type $viewRootFolder
  * @param type $cacheFolder
  * @param type $debug
  * @return \Twig_Environment
  */
 protected function createTwig($viewRootFolder, $cacheFolder, $debug)
 {
     $this->loader = new \Twig_Loader_Filesystem($viewRootFolder);
     $twig = new \Twig_Environment($this->loader);
     $twig->enableStrictVariables();
     if ($debug === true) {
         $twig->enableDebug();
     } else {
         $twig->disableDebug();
         $twig->setCache($cacheFolder);
     }
     return $twig;
 }
開發者ID:blendsdk,項目名稱:blendengine,代碼行數:20,代碼來源:TwigEngine.php

示例3: Alert

//die('ok up to here');
//test mailer
//echo send_email($generalConfig);
$alertHandler = new Alert();
$formatter = new Formatter();
foreach ($regions as $region => $values) {
    $loader = new Twig_Loader_Filesystem(TWIG_TEMPLATES . '/' . $region);
    // TODO:
    // For some reason cache is not invalidated with chages - check it out then enable
    //$twig = new Twig_Environment($loader,array('cache' => TWIG_TEMPLATES.'/cache'));
    /// ... in the meantime
    $twig = new Twig_Environment($loader);
    if (SET_DEBUG) {
        $twig->enableDebug();
    } else {
        $twig->disableDebug();
    }
    // ... load the template
    outputStatus('Load html template ...');
    $template = $twig->loadTemplate('send_recommended/send_all.html');
    outputStatus('Region ' . $region);
    foreach ($sections as $section => $secParams) {
        outputStatus('Traverse section ' . $section);
        $formatter_conf = array('section' => $section, 'region' => $region, 'months' => $values['months'], 'base_domain' => $values['base_domain']);
        // var_dump($formatter_conf);die;
        $spx_config = $region . '_sphinx_' . $section;
        $alertHandler->resetArrays();
        $liveDB = new DBAdapter2(array('host' => $conf->dbserver->host, 'username' => $conf->dbserver->username, 'password' => $conf->dbserver->password, 'schema' => $values['live_schema']));
        // First drop all alerts older than specified!
        $moreToFetch = TRUE;
        $offset = 0;
開發者ID:sergrin,項目名稱:crawlers-il,代碼行數:31,代碼來源:alert_saved_searches.php


注:本文中的Twig_Environment::disableDebug方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。