Beispiel #1
0
<?php

//-->
use Cradle\Handlebars\HandlebarsData as Data;
use Cradle\Handlebars\HandlebarsRuntime as Runtime;
return function ($data = array()) {
    $noop = function () {
    };
    $context = $data = Data::i($data);
    $helper = Runtime::getHelpers($data);
    $buffer = '';
    $buffer .= '<div class="product-fields">' . "\n";
    $buffer .= '	<div class="form-group';
    $buffer .= $helper['if']($data->find('errors.product_title'), array('name' => 'if', 'args' => 'if errors.product_title', 'hash' => array(), 'fn' => function ($context = null) use($noop, $data, &$helper) {
        if (is_array($context)) {
            $data->push($context);
        }
        $buffer = '';
        $buffer .= ' has-error';
        if (is_array($context)) {
            $data->pop();
        }
        return $buffer;
    }, 'inverse' => $noop));
    $buffer .= ' clearfix">' . "\n";
    $buffer .= '        <label class="control-label">';
    $buffer .= htmlspecialchars($data->find('_ \'Title\''), ENT_COMPAT, 'UTF-8');
    $buffer .= '</label>' . "\n";
    $buffer .= '        <div>' . "\n";
    $buffer .= '            <input' . "\n";
    $buffer .= '                type="text"' . "\n";
 /**
  * @covers Cradle\Handlebars\HandlebarsRuntime::unregisterPartial
  */
 public function testUnregisterPartial()
 {
     HandlebarsRuntime::registerPartial('foo', 'bar');
     HandlebarsRuntime::unregisterPartial('foo');
     $this->assertNull(HandlebarsRuntime::getPartial('foo'));
 }