['template' => '
'], 'TBODY' => ['template' => ''], 'TD' => $this->generateCellTagConfig('td'), 'TH' => $this->generateCellTagConfig('th'), 'THEAD' => ['template' => ''], 'TR' => ['template' => ''] ]; foreach ($tags as $tagName => $tagConfig) { if (!isset($this->configurator->tags[$tagName])) { $this->configurator->tags->add($tagName, $tagConfig); } } } /** * Generate the tag config for give cell element * * @param string $elName Element's name, either "td" or "th" * @return array Tag config */ protected function generateCellTagConfig($elName) { $alignFilter = new ChoiceFilter(['left', 'center', 'right', 'justify'], true); return [ 'attributes' => [ 'align' => [ 'filterChain' => ['strtolower', $alignFilter], 'required' => false ] ], 'rules' => ['createParagraphs' => false], 'template' => '<' . $elName . '> text-align: ' ]; } /** * {@inheritdoc} */ public function asConfig() { return [ 'overwriteEscapes' => isset($this->configurator->Escaper), 'overwriteMarkdown' => isset($this->configurator->Litedown) ]; } }