Closed augustohp closed 12 years ago
@alganet show some love for this when you can =D
The developer should avoid writing HTML or declaring elements, but it may be necessary. We shouldn't spend much effort in this, but it is appropriate.
HtmlElement could also have a static builder:
HtmlElement::acronym(); //<acronym/>
HtmlElement::acronym('Hi there'); //<acronym>Hi there</acronym>
HtmlElement::acronym('Hi there')->title('How ya doin?'); //<acronym title="How ya doin?">Hi there</acronym>
HtmlElement::acronym('Hi there')->title('How ya doin?')->class("nice_class"); //you got it
Then, we import use HtmlElement as h
and we can do some nice stuff:
print
h::html(
h::head(
h::title('Hi!')
),
h::body(
h::h1('Hello')->id('oi'),
h::ul(
h::li('foo'),
h::li('bar'),
h::li('baz')
),
h::input()->type('text')->name('username')->value('')
)
);
Couple months ago I've implemented this: https://gist.github.com/1138479 together with DOMDocumentFragments I believe we could use it.
Consider it done, I forgot about this =D
Added HtmlElement in ec770bbed9, test missing.
Awesome!
Bwesome!
Threesome! Oh, wait...
Actually we removed a lot of burden from the designer and threw a lot of work into the PHP developer. We really have to remove this burden to the maximum before we can continue, look at what about i'm saying:
Take a look to the example:
This does not imposes fear, but think of the CSS style importer, the links, the acronym and so on .... The markup to the developer will become messy.
A solution would be to have a "HTMLElement" class
What do you think about it? Can't come up with a better solution for this by now.