/** * {@inheritdoc} */ public function __invoke(OutputBuffer $out) { $builder = new TagBuilder('form'); $this->populatePassthroughAttributes($builder); $builder->addClass('kk'); $builder->set('method', strtolower($this->method)); $builder->set('accept-charset', strtolower($out->getEncoding())); $builder->setBoolean('novalidate', $this->novalidate); if (NULL !== ($action = $this->action)) { $builder->set('action', $action); } if (!$builder->has('enctype')) { $builder->set('enctype', $this->upload ? Http::FORM_MULTIPART_ENCODED : Http::FORM_ENCODED); } $buffer = $this->renderNestedNodes($out->createBuffer(), $builder); $out->writeTag($builder, $buffer, false); }
public function __invoke(OutputBuffer $out) { $text = html_entity_decode($this->renderNestedNodes($out->createBuffer()), ENT_QUOTES, $out->getEncoding()); $out->write('<!-- ' . preg_replace("'-+'", '-', $text) . ' -->'); }