• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Renderer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: testRender_ChangeValueHasStringType

 /**
  * @dataProvider renderChangeDataProvider
  * @param $expectedDiff
  * @param $oldValue
  * @param $newValue
  * @param array|null $renderOptions
  */
 public function testRender_ChangeValueHasStringType($expectedDiff, $oldValue, $newValue, array $renderOptions = null)
 {
     $expectedDiff = implode(PHP_EOL, $expectedDiff);
     $diffRenderer = new Renderer($renderOptions);
     $actualDiff = $diffRenderer->render(new Change(implode(PHP_EOL, $oldValue), implode(PHP_EOL, $newValue)));
     $this->assertEquals($expectedDiff, $actualDiff);
 }
开发者ID:sokil,项目名称:php-diff,代码行数:14,代码来源:RendererTest.php


示例2: _render

 /**
  * Render request
  *
  * @param array       $data
  * @param string|null $template
  * @param string|null $blockClass
  * @return $this
  */
 protected function _render(array $data = array(), $template = null, $blockClass = null)
 {
     //create block
     if ($blockClass) {
         $blockClass = '\\App\\Block' . '\\' . $blockClass;
         $block = new $blockClass($data);
     } else {
         $block = new Renderer($data);
     }
     if (!$template) {
         //set template
         $template = $this->getControllerName() . DIRECTORY_SEPARATOR . $this->getActionName() . '.phtml';
     }
     $block->setTemplate($template);
     //get action HTML
     $actionHtml = $block->toHtml();
     if (!$this->isAjax()) {
         $block = new Renderer(array('content' => $actionHtml));
         $block->setTemplate('index.phtml');
         //add system messages block
         $message = new Message();
         $message->setTemplate('index/messages.phtml');
         $block->setChild('message', $message);
         echo $block->toHtml();
     } else {
         echo $actionHtml;
     }
     return $this;
 }
开发者ID:andkirby,项目名称:commithook,代码行数:37,代码来源:TestClassSplit.php


示例3: getFinishedSniplet

 public static function getFinishedSniplet()
 {
     $taoExt = common_ext_ExtensionsManager::singleton()->getExtensionById('tao');
     $tpl = $taoExt->getConstant('DIR_VIEWS') . 'templates' . DIRECTORY_SEPARATOR . 'snippet' . DIRECTORY_SEPARATOR . 'finishService.tpl';
     $renderer = new Renderer($tpl);
     return $renderer->render();
 }
开发者ID:oat-sa,项目名称:tao-core,代码行数:7,代码来源:class.ServiceJavascripts.php


示例4: getStuff

 public static function getStuff()
 {
     $config = self::getConfig();
     if (common::LoggedIn()) {
         if ($config['wysiwygEnabled']) {
             global $addonPathCode, $page;
             require_once $addonPathCode . "/Renderer.php";
             $renderer = new Renderer($config, $addonPathCode . "/lib/parsedown");
             print $renderer->render($_REQUEST['content']);
             //haha, very secure. NOT!
             $nonce_str = 'EasyMark4Life!';
             //TODO: sanitize $config stuff
             //"stuff" is defined in edit.js
             print "<script>";
             print "var nonceStr = '" . $nonce_str . "';";
             print "var postNonce = '" . common::new_nonce('post', true) . "';";
             print "setTimeout(stuff, " . htmlspecialchars($config['wysiwygDelay']) . "*1000);";
             print "</script>";
             // cleanup old page object
             unset($page);
         }
     } else {
         print "Have to be logged in to use this feature";
     }
 }
开发者ID:ppeterka,项目名称:easymark,代码行数:25,代码来源:WYSIWYG.php


示例5: getAuthoring

 /**
  * @deprecated
  * @see taoTests_models_classes_TestModel::getAuthoring()
  */
 public function getAuthoring(core_kernel_classes_Resource $test)
 {
     $process = $test->getUniquePropertyValue(new core_kernel_classes_Property(TEST_TESTCONTENT_PROP));
     $ext = common_ext_ExtensionsManager::singleton()->getExtensionById('taoWfAdvTest');
     $widget = new Renderer($ext->getConstant('DIR_VIEWS') . 'templates' . DIRECTORY_SEPARATOR . 'authoring.tpl');
     $widget->setData('processUri', $process->getUri());
     $widget->setData('label', __('Authoring %s', $test->getLabel()));
     return $widget->render();
 }
开发者ID:oat-sa,项目名称:extension-tao-testwfauthoring,代码行数:13,代码来源:class.WfAdvTestModel.php


示例6: testGetProductPriceHtml

 /**
  * @covers \Magento\Checkout\Block\Cart\Item\Renderer::getProductPriceHtml
  * @covers \Magento\Checkout\Block\Cart\Item\Renderer::getPriceRender
  */
 public function testGetProductPriceHtml()
 {
     $priceHtml = 'some price html';
     $product = $this->getMockBuilder('Magento\\Catalog\\Model\\Product')->disableOriginalConstructor()->getMock();
     $priceRender = $this->getMockBuilder('Magento\\Framework\\Pricing\\Render')->disableOriginalConstructor()->getMock();
     $this->layout->expects($this->atLeastOnce())->method('getBlock')->with('product.price.render.default')->will($this->returnValue($priceRender));
     $priceRender->expects($this->once())->method('render')->with(\Magento\Catalog\Pricing\Price\ConfiguredPriceInterface::CONFIGURED_PRICE_CODE, $product, ['include_container' => true, 'display_minimal_price' => true, 'zone' => \Magento\Framework\Pricing\Render::ZONE_ITEM_LIST])->will($this->returnValue($priceHtml));
     $this->assertEquals($priceHtml, $this->_renderer->getProductPriceHtml($product));
 }
开发者ID:,项目名称:,代码行数:13,代码来源:


示例7: Render

 public function Render(Renderer $renderer)
 {
     $superGlobals = GetApplication()->GetSuperGlobals();
     if ($superGlobals->GetGetValueDef(ModalOperation::Param) == ModalOperation::OpenModalEditDialog || $superGlobals->GetGetValueDef(ModalOperation::Param) == ModalOperation::OpenModalInsertDialog) {
         $this->grid->GetGrid()->GetPage()->UpdateValuesFromUrl();
     }
     $this->grid->ProcessMessages();
     echo $renderer->Render($this->grid);
 }
开发者ID:outsourcinggithub,项目名称:outsourcing,代码行数:9,代码来源:modal_edit_handler.php


示例8: getAuthoring

 /**
  * (non-PHPdoc)
  * 
  * @see taoTests_models_classes_TestModel::getAuthoring()
  */
 public function getAuthoring(core_kernel_classes_Resource $content)
 {
     common_Logger::i('Generating form for delivery content ' . $content->getUri());
     $widget = new Renderer($this->extension->getConstant('DIR_VIEWS') . 'templates' . DIRECTORY_SEPARATOR . 'authoring.tpl');
     $form = new taoSimpleDelivery_actions_form_ContentForm($this->getClass(), $content);
     $widget->setData('formContent', $form->getForm()->render());
     $widget->setData('saveUrl', _url('save', 'Authoring', 'taoSimpleDelivery'));
     $widget->setData('formId', $form->getForm()->getName());
     return $widget->render();
 }
开发者ID:nagyist,项目名称:extension-tao-deliverysimple,代码行数:15,代码来源:class.ContentModel.php


示例9: getAuthoring

 /**
  * @deprecated
  * @see taoTests_models_classes_TestModel::getAuthoring()
  */
 public function getAuthoring(core_kernel_classes_Resource $test)
 {
     $ext = common_ext_ExtensionsManager::singleton()->getExtensionById('taoWfTest');
     $testService = taoTests_models_classes_TestsService::singleton();
     $itemSequence = array();
     $itemUris = array();
     $i = 1;
     foreach ($testService->getTestItems($test) as $item) {
         $itemUris[] = $item->getUri();
         $itemSequence[$i] = array('uri' => tao_helpers_Uri::encode($item->getUri()), 'label' => $item->getLabel());
         $i++;
     }
     // data for item sequence, terrible solution
     // @todo implement an ajax request for labels or pass from tree to sequence
     $allItems = array();
     foreach ($testService->getAllItems() as $itemUri => $itemLabel) {
         $allItems['item_' . tao_helpers_Uri::encode($itemUri)] = $itemLabel;
     }
     $widget = new Renderer($ext->getConstant('DIR_VIEWS') . 'templates' . DIRECTORY_SEPARATOR . 'authoring.tpl');
     $widget->setData('uri', $test->getUri());
     $widget->setData('allItems', json_encode($allItems));
     $widget->setData('itemSequence', $itemSequence);
     // data for generis tree form
     $widget->setData('relatedItems', json_encode(tao_helpers_Uri::encodeArray($itemUris)));
     $openNodes = tao_models_classes_GenerisTreeFactory::getNodesToOpen($itemUris, new core_kernel_classes_Class(TAO_ITEM_CLASS));
     $widget->setData('itemRootNode', TAO_ITEM_CLASS);
     $widget->setData('itemOpenNodes', $openNodes);
     $widget->setData('saveUrl', _url('saveItems', 'Authoring', 'taoWfTest'));
     return $widget->render();
 }
开发者ID:nagyist,项目名称:extension-tao-testwf,代码行数:34,代码来源:class.WfTestModel.php


示例10: testRender

 /**
  * render() should recursively render each group
  */
 public function testRender()
 {
     $root = (new Element\Group())->appendChild(new Element\Text('foo '))->appendChild((new Element\Group())->appendChild(new Element\Control\Word\B())->appendChild(new Element\Text('bar'))->appendChild(new Element\Control\Word\B(0)));
     $this->assertFalse($root->getIsRendered());
     $renderer = new Renderer();
     $root = $renderer->render($root);
     $this->assertTrue($root instanceof Element\Group);
     $this->assertTrue($root->getIsRendered());
     $this->assertTrue($root->getLastChild()->getChild(1)->getStyle()->getCharacter()->getIsBold());
     return;
 }
开发者ID:jstewmc,项目名称:rtf,代码行数:14,代码来源:RenderTest.php


示例11: __construct

 function __construct($get)
 {
     $this->php_fixes();
     // it's easier to handle some redirection through php rather than relying on a more complex .htaccess file to do all the work
     if ($this->handle_redirects()) {
         return;
     }
     // parse get request
     $r = new Renderer($get);
     // handle rendering of the page
     $r->render();
 }
开发者ID:rahulbot,项目名称:portfolio-website,代码行数:12,代码来源:stacey.inc.php


示例12: getAuthoring

 /**
  * @deprecated
  * @see taoTests_models_classes_TestModel::getAuthoring()
  */
 public function getAuthoring(core_kernel_classes_Resource $test)
 {
     $testService = taoTests_models_classes_TestsService::singleton();
     $class = new core_kernel_classes_Class(CLASS_LTI_TESTCONTENT);
     $content = $test->getOnePropertyValue(new core_kernel_classes_Property(TEST_TESTCONTENT_PROP));
     common_Logger::i('Generating form for ' . $content->getUri());
     $form = new ltiTestConsumer_actions_form_LtiLinkForm($content);
     $form->getForm()->setActions(array());
     $widget = new Renderer($this->extension->getConstant('DIR_VIEWS') . 'templates' . DIRECTORY_SEPARATOR . 'authoring.tpl');
     $widget->setData('formContent', $form->getForm()->render());
     $widget->setData('saveUrl', _url('save', 'Authoring', 'ltiTestConsumer'));
     $widget->setData('formName', $form->getForm()->getName());
     return $widget->render();
 }
开发者ID:nagyist,项目名称:extension-tao-testlti,代码行数:18,代码来源:class.LtiTestModel.php


示例13: SectionToContent

 function SectionToContent($section_data)
 {
     global $addonPathCode, $addonPathData;
     if ($section_data['type'] == self::$sectionType) {
         $config = array();
         $conf = $addonPathData . '/config.php';
         if (file_exists($conf)) {
             include $conf;
             $config = $settings;
         }
         require_once $addonPathCode . "/Renderer.php";
         $renderer = new Renderer($config, $addonPathCode . "/lib/parsedown/");
         $section_data['content'] = $renderer->render($section_data['content']);
     }
     return $section_data;
 }
开发者ID:ppeterka,项目名称:easymark,代码行数:16,代码来源:EasyMark.php


示例14: getAdd

 public function getAdd($parentModel, $relation, $idParentModel)
 {
     $parentList = $parentModel::find($idParentModel);
     $relation = $parentList->{$relation}();
     $sonModel = $relation->getRelated();
     $sonList = new $sonModel();
     $fk = $relation->getForeignKey();
     $sonList->{$fk} = $idParentModel;
     $sonList->save();
     $renderer = new Renderer();
     if (!($tableParams = Session::get($renderer::PREFIX_SESSION_AJAX_LIST . $_GET["listToken"]))) {
         $result = "<span>Error al actualizar tabla, por favor, recargue la página</span>";
     } else {
         $result = $renderer->generateAjaxListFromRelation($tableParams[0], $tableParams[1], $tableParams[2], $tableParams[3], $tableParams[4], $tableParams[5]);
     }
     return json_encode($result);
 }
开发者ID:albafo,项目名称:web.Adehon,代码行数:17,代码来源:AjaxListController.php


示例15: testAddGlobal

 public function testAddGlobal()
 {
     $this->assertFalse(isset($globals['test-key']));
     Renderer::addGlobal('test-key', 'test-value');
     $globals = Renderer::getGlobals();
     $this->assertTrue(isset($globals['test-key']));
     $this->assertEquals('test-value', $globals['test-key']);
 }
开发者ID:a11enwong,项目名称:pochika,代码行数:8,代码来源:RendererTest.php


示例16: renderException

 /**
  * @param \Exception $exception
  * @throws Exception\ConfigParameterNotFound
  */
 public function renderException(\Exception $exception)
 {
     $templatePath = join(DIRECTORY_SEPARATOR, [Renderer::getUserViewDirectory(), 'errors', 'error.php']);
     if (!file_exists($templatePath)) {
         $templatePath = join(DIRECTORY_SEPARATOR, [self::VIEW_PATH, 'error.php']);
     }
     extract(['exception' => $exception]);
     $this->sendHeadersWithHttpCode($exception->getCode());
     require_once $templatePath;
 }
开发者ID:vehsamrak,项目名称:vehsa,代码行数:14,代码来源:ErrorHandler.php


示例17: SysMessage

/**
 * This is the "soft" error handler as well as a general "Hey Link!" notifier.
 * Will cancel execution, wipe the buffer and display a message instead (Eg. "You have watched Username").
 * 
 * @param string $msg The message to be displayed
 * @param string $return An URL. Page will autoredirect (and offer a clickable link) to the url specified.
 * @return void
 */
function SysMessage($msg, $return)
{
    require_once $_SERVER['DOCUMENT_ROOT'] . '/sys/Render.php';
    // Just incase it hasn't already been included.
    ob_clean();
    // Remove whatever output already present, we won't need it.
    echo Renderer::GetSysMessageHTML();
    //Ask the renderer to render a complete SysMessage HTML template, and output it.
    exit;
    // This should boot us directly to FatalErrorHandler which will output everything.
}
开发者ID:KeiroD,项目名称:openaffinity,代码行数:19,代码来源:Kernel.php


示例18: renderReport

 /**
  * Document this if implementing.
  * 
  * @param DOMDocument   $xslFo    The FO
  * @param sfWebResponse $response The Response.
  * 
  * @return string The output 
  * @see Renderer::renderReport()
  */
 public function renderReport(DOMDocument $xslFo, sfWebResponse $response = null)
 {
     $out = parent::renderReport($xslFo);
     self::$_xPath = new DOMXPath($xslFo);
     $fileName = self::$_xPath->query('//fo:title');
     $fileName = 'Report' . (string) $fileName->item(0) . '-' . date('Y-m-d');
     header("Content-type: application/octet-stream");
     header("Content-Disposition: attachment; filename={$fileName}.xls");
     header("Pragma: no-cache");
     header("Expires: 0");
     return $out;
 }
开发者ID:backstageel,项目名称:neatReports,代码行数:21,代码来源:RenderXls.php


示例19: outputXml

 /**
  * @param array  $data
  * @param string $template_file
  *
  * @return $this
  */
 public function outputXml($data, $template_file)
 {
     $this->outputHeader();
     $renderer = $this->renderer->getRenderer();
     if (is_array($data) or is_object($data)) {
         foreach ($data as $k => $v) {
             $renderer->set($k, $v);
         }
     }
     $xml = $renderer->setTemplate($template_file)->render();
     $this->Xml->set(XmlOutput::CONTENT, $xml)->flush();
     $this->flushBuffer();
     return $this;
 }
开发者ID:lixiongyou,项目名称:pudding,代码行数:20,代码来源:Output.php


示例20: update

 function update($show, $arg)
 {
     if ($arg == 'done') {
         $page = $this->getcurrentPage();
         Renderer::getinstance()->setoption('plugin_trackback_pingurlrdf', $this->getpingurlrdf($page));
         $list = $this->getlist($page);
         if (count($list) > 0) {
             $smarty = $this->getSmarty();
             $smarty->assign('pagename', $page->getpagename());
             $smarty->assign('trackback', $list);
             $this->setbody($smarty->fetch('list.tpl.htm'));
         }
     }
 }
开发者ID:riaf,项目名称:kinowiki,代码行数:14,代码来源:trackback.inc.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP RepairAndClear类代码示例发布时间:2022-05-23
下一篇:
PHP Render类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap