public function testWidget() { ob_start(); ob_implicit_flush(false); echo "<body>\n"; Spaceless::begin(); echo "\t<div class='wrapper'>\n"; Spaceless::begin(); echo "\t\t<div class='left-column'>\n"; echo "\t\t\t<p>This is a left bar!</p>\n"; echo "\t\t</div>\n\n"; echo "\t\t<div class='right-column'>\n"; echo "\t\t\t<p>This is a right bar!</p>\n"; echo "\t\t</div>\n"; Spaceless::end(); echo "\t</div>\n"; Spaceless::end(); echo "\t<p>Bye!</p>\n"; echo "</body>\n"; $expected = "<body>\n<div class='wrapper'><div class='left-column'><p>This is a left bar!</p>" . "</div><div class='right-column'><p>This is a right bar!</p></div></div>\t<p>Bye!</p>\n</body>\n"; $this->assertEquals($expected, ob_get_clean()); }
<?php Spaceless::begin(); ?> <?php echo $form->field($model, 'min_price', ['template' => "{input}"])->textInput(['name' => $directPopulating ? 'min_price' : null, 'placeholder' => Yii::t('app', 'Price from')]); ?> <?php echo $form->field($model, 'max_price', ['template' => "{input}"])->textInput(['name' => $directPopulating ? 'max_price' : null, 'class' => 'without-left-border', 'placeholder' => Yii::t('app', 'Price to')]); ?> <?php echo $form->field($model, 'currency', ['options' => ['tag' => false], 'template' => "{input}"])->dropDownList(Currency::getDropDownList(), ['name' => $directPopulating ? 'currency' : null]); ?> <?php Spaceless::end(); ?> </div> </div> <div class="right"> <?php echo $form->field($model, 'content', ['template' => "{input}"])->textarea(['name' => $directPopulating ? 'content' : null]); ?> <div class="button-container"> <?php if ($model->isNewRecord || $model->templet) { ?> <?php echo Html::submitButton(Yii::t('app', 'Publish'));