views:

38

answers:

2

I've created a class in PHP that allows you to create custom HTML markup. It basically works a bit like FB Markup or EE tags. It works off a tag prefix, so you can add tags like this.

<ctag:pagination per_page="20" total="500" page="0" base="http://localhost/page?page={page}" mode="smart" adjecents="5" />

My question is: Is the markup above better than the markup below? I'm asking as I'm considering branching my code to rework the tag matching so you can just generate custom html elements. It would well for a drop in HTML5 replacement service. Match the User Agent for a none HTML5 browser and replace the HTML5 elements with your own replacements.

<pagination per_page="20" total="500" page="0" base="http://localhost/page?page={page}" mode="smart" adjecents="5" />

PS, if anybody wants to look at the class I've put a download here.

+2  A: 

Well it really depends on how you see it.

To me the markup below is better but in with future markup tags that may pop up here and there, yours may conflict.

The prefix indicates more or less that its yours and its to not be mixed up with someone Else's code.

I'm sure that there are many other opinions but this is mine.

Jonathan Czitkovics
Good point about the future markup. I hadn't really considered that at all.
buggedcom
+1  A: 

I'd go with the first one, because a man can still hope that someday, maybe, browsers will finally support XHTML with namespaces. It also cannot hurt to stick to an established standard, in case some wants to parse your markup with an XML Parser.

Gordon