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


PHP Builder::render方法代码示例

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


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

示例1: create

 /**
  * @param string $outputFilePath
  * @return type
  */
 public function create($outputFilePath = '')
 {
     $this->initImage();
     $width = $this->getImageHandler()->getImageWidth();
     $height = $this->getImageHandler()->getImageHeight();
     $Builder = new Builder();
     $Builder->setBackgroundCharacter('-');
     $Builder->setCanvasSize($width, $height);
     for ($y = 0; $y <= $height - 1; $y++) {
         for ($x = 0; $x <= $width - 1; $x++) {
             $Builder->setPoint(new Point(new Coordinate($x, $y), $this->getImageHandler()->getCharByCoordinate($x, $y)));
         }
     }
     if (trim($outputFilePath) == '') {
         return $Builder->render(true);
     }
     file_put_contents($outputFilePath, $Builder->render(true));
 }
开发者ID:moszkva,项目名称:cgraph,代码行数:22,代码来源:FileFactory.php

示例2: slash

 /**
  * Add your code below.
  */
 public function slash()
 {
     $builder = new Builder();
     $builder->config(file_get_contents(base_path('composer.json')));
     $builder->set('name', 'phalconslayer/slayer');
     $builder->merge('require', ['phalconslayer/framework' => '1.4.*']);
     $validation = $builder->validate();
     if (!$validation['valid']) {
         if (isset($validation['publish_error'])) {
             throw new \Exception('Publish Error found ' . json_encode($validation['publish_error']));
         }
         if (isset($validation['error'])) {
             throw new \Exception('Error found ' . json_encode($validation['error']));
         }
     }
     file_put_contents(base_path('composer.json'), $builder->render());
 }
开发者ID:phalconslayer,项目名称:framework,代码行数:20,代码来源:TestConsole.php

示例3: build

 public function build()
 {
     $builder = new Builder();
     $this->output = $builder->render($this->settings);
 }
开发者ID:sekayasin,项目名称:Drupal-8-Developer-Prep-Resource-Pack,代码行数:5,代码来源:Page.php

示例4: Builder

<?php

require_once __DIR__ . '/lib/Builder.php';
require_once __DIR__ . '/lib/ContactUsController.php';
// Instantiate a Builder object to use below.
$builder = new Builder();
// Create an array for the contact form.
$contact_form = array('name' => array('title' => 'Name', 'type' => 'text', 'validations' => array('not_empty')), 'email' => array('title' => 'Email', 'type' => 'email', 'validations' => array('not_empty', 'is_valid_email')), 'comment' => array('title' => 'Comments', 'type' => 'textarea', 'validations' => array('not_empty')), 'submit' => array('title' => 'Submit me!', 'type' => 'submit'));
// Create an array for the footer content and render it.
$footer_content = array('divider' => array('type' => 'html', 'value' => '<hr />'), 'content' => array('type' => 'html', 'value' => '<div style="text-align:center">&copy; ' . date('Y') . ' BuildAModule</div>'));
$footer = $builder->render($footer_content);
// Create an array for the page.
$page_elements = array('header' => array('type' => 'html', 'value' => '<p>Please submit this form. You will make my day if you do.</p>'), 'contact_form' => array('type' => 'form', 'value' => $contact_form), 'footer' => array('type' => 'html', 'value' => $footer));
print ContactUsController::ContactUsPage($page_elements);
开发者ID:sekayasin,项目名称:Drupal-8-Developer-Prep-Resource-Pack,代码行数:14,代码来源:index.php


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