Working with PHP DOM - html manipulation. It's really very effective way to output HTML markup (at least, prevents mess of logic and markup in code).
But, to generate 50 line of html markup, one must write about 200 lines in PHP :( .
Example piece of code:
...
$signup_form = $document->createElement('form');
$signup_form->setAttribute('id', 'signup_form');
$signup_form->setAttribute('action', 'registration/signup.php');
$signup_form->setAttribute('method', 'post');
$su_fname_label = $document->createElement('label');
$su_fname_label->setAttribute('for', 'fname');
$su_fname_label_content = $document->createTextNode('Name');
$su_fname_label->appendChild($su_fname_label_content);
$su_fname_textbox = $document->createElement('input');
$su_fname_textbox->setAttribute('name', 'fname');
$su_fname_textbox->setAttribute('class', 'valid');
$su_fname_textbox->setAttribute('placeholder', 'Please enter your name');
$su_fname_textbox->setAttribute('type', 'text');
...
As you see, It's only 1 element of form. Imagine, If there are 5 elements in HTML form, php code will be huge. I wonder, is there any way to minify for ex. by setting multiple attributes at once? Any suggestions?