my phail html fraemwerk

Posted on
framework mvc php

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

container and if you create form class you’ll have 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