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


PHP TimberHelper::ob_function方法代碼示例

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


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

示例1: testCommentForm

 function testCommentForm()
 {
     $post_id = $this->factory->post->create();
     $form = TimberHelper::ob_function('comment_form', array(array(), $post_id));
     $form = trim($form);
     $this->assertStringStartsWith('<div id="respond"', $form);
 }
開發者ID:timber,項目名稱:timber,代碼行數:7,代碼來源:test-timber-helper.php

示例2: call

 /**
  *
  *
  * @return string
  */
 public function call()
 {
     $args = $this->_parse_args(func_get_args(), $this->_args);
     if ($this->_use_ob) {
         return TimberHelper::ob_function($this->_function, $args);
     } else {
         return call_user_func_array($this->_function, $args);
     }
 }
開發者ID:Butterwell,項目名稱:timber,代碼行數:14,代碼來源:timber-function-wrapper.php

示例3: testAgainstFooterFunctionOutput

 function testAgainstFooterFunctionOutput()
 {
     global $wp_scripts;
     $wp_scripts = null;
     wp_enqueue_script('colorpicker', false, array(), false, true);
     wp_enqueue_script('fake-js', 'http://example.org/fake-js.js', array(), false, true);
     $wp_footer = TimberHelper::ob_function('wp_footer');
     global $wp_scripts;
     $wp_scripts = null;
     wp_enqueue_script('colorpicker', false, array(), false, true);
     wp_enqueue_script('fake-js', 'http://example.org/fake-js.js', array(), false, true);
     $str = Timber::compile_string('{{function("wp_footer")}}');
     $this->assertEquals($wp_footer, $str);
     $this->assertGreaterThan(50, strlen($str));
 }
開發者ID:Butterwell,項目名稱:timber,代碼行數:15,代碼來源:test-timber-wp-functions.php

示例4: defined

<?php

/**
 * @package   Gantry 5 Theme
 * @author    RocketTheme http://www.rockettheme.com
 * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
 * @license   GNU/GPLv2 and later
 *
 * http://www.gnu.org/licenses/gpl-2.0.html
 */
defined('ABSPATH') or die;
/*
 * The template for displaying BBPress pages
 */
$gantry = Gantry\Framework\Gantry::instance();
$theme = $gantry['theme'];
// We need to render contents of <head> before plugin content gets added.
$context = Timber::get_context();
$context['page_head'] = $gantry->isCompatible('5.1.5') ? $theme->render('partials/page_head.html.twig', $context) : null;
$context['posts'] = Timber::query_post();
$context['content'] = TimberHelper::ob_function('the_content');
Timber::render('bbpress.html.twig', $context);
開發者ID:mazykin46,項目名稱:portfolio,代碼行數:22,代碼來源:buddypress.php


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