-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adapters #19
Comments
Are the adapters still a requirement as it seems HtmlElement manages quite fine without? <?php
public function getDOMNode(DOMDocument $dom, $current=null)
{
if (is_string($current))
return new DOMText($current);
$current = $current ?: $this ;
$node = $dom->createElement($current->nodeName);
foreach ($current->attributes as $name=>$value)
$node->setAttribute($name, $value);
if (!count($current->childrenNodes))
return $node;
foreach ($current->childrenNodes as $child)
$node->appendChild($this->getDOMNode($dom, $child));
return $node;
} Should we maybe refactor and remove adapters? |
Been following this for quite some time. This week discussions came up and this document was raised again. I don't like it and maybe I didn't get it, but we really COULD use the insertion modes described as ou Adapters implementation. Let me know what you think on the HTML Template |
Will need to read it again, why they want to make things so complicating no one will know. That comment of mine is very dated and I answered myself by rewriting the module 5 times now already. |
We must implement/create a number of Adapters that transform `arrays
to
DomElements`` to be appended to the document. There is a simple adapter example (Adapters/A.php), but we must accept more situations to adapt:Can you come up with more ideas?
The text was updated successfully, but these errors were encountered: