Posted by: fudanchii | June 7, 2009

my phail html fraemwerk

To inquiry the old design on my latest project, as I decide to re-design it to use MVC model, I need some html rendering class to create some gridview and form-like view. I know that it would be easier to write inline html in the code. But it would be harder to maintain as the file number increase. So I think if I use this framework to do the job it would be looked more neat, or no? ._.
My design is to create this baseview class as parent class. Baseview contain some base properties which is used in all view (grid or form). Then there would be gridview and formview class which inherit baseview. The classes act as container for the view, I mean if you create gridview class then you have
<table> container and if you create form class you’ll have <form> container.
The problem is how to standardize the formview classes. As the form component has some non standard variation. Input tag is distinguished by its type parameter. And there’s select tag with option tag for selection elements, etc…
Each inherited classes has render method. I wonder if I should unifiy the method, but it have to be good if I has unified array-like object which then I can iterate over it to render the html tags. Currently working on the design of that object.
But then I think there’s something missing on the whole design…
Like how can I add the javascript in the header, since the content called right after the header, but the javascript is forked inside the content…
:-\
need suggestion…
I don’t think I would use existing PHP framework

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: