本文整理汇总了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));
}
示例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());
}
示例3: build
public function build()
{
$builder = new Builder();
$this->output = $builder->render($this->settings);
}
示例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">© ' . 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);