public function testBuildBooleanAttribute() { // prepare $htmlTagBuilder = new HtmlTagBuilder('iframe', array('class' => 'videoWrapper', 'allowfullscreen' => null)); // execute $tag = $htmlTagBuilder->toString(); // verify $this->assertContains('<iframe class="videoWrapper" allowfullscreen></iframe>', $tag); }
/** * @param $renderApi * @param \Render\Unit $unit * @param \Render\ModuleInfo $moduleInfo */ public function renderContent($renderApi, $unit, $moduleInfo) { $child = new ChildModuleDependency(); if ($child->isInsideModule($renderApi, $unit, 'rz_form')) { $this->renderFormFieldContent($renderApi, $unit); } else { $i18n = new Translator($renderApi, $moduleInfo); $msg = $i18n->translate('error.moduleOnlyWorkingInForm'); $errorTag = new HtmlTagBuilder('div', array('class' => 'RUKZUKmissingInputHint'), array(new HtmlTagBuilder('button', array('style' => 'cursor: default;'), array($msg)))); echo $errorTag->toString(); } }
public function renderContent($renderApi, $unit, $moduleInfo) { $moduleDependency = new \LightboxModuleDependency(); if (!$moduleDependency->isInsideModule($renderApi, $unit, 'rz_lightbox')) { $renderApi->renderChildren($unit); } else { $i18n = new Translator($renderApi, $moduleInfo); $msg = $i18n->translate('error.noLightboxModuleInheritance'); $errorTag = new HtmlTagBuilder('div', array('class' => 'RUKZUKmissingInputHint'), array(new HtmlTagBuilder('button', array('style' => 'cursor: default;'), array($msg)))); echo $errorTag->toString(); } }
/** * @param HtmlTagBuilder $confirmation * @param string|null $emailConfirmationText * * @return string */ protected function getEmailBody($confirmation, $emailConfirmationText = null) { if (empty($emailConfirmationText)) { return $confirmation->toString(); } else { $emailBody = HtmlTagBuilder::div()->appendText($emailConfirmationText)->append($confirmation); return $emailBody->toString(); } }