PHP MVC - handling views -


i've found framework handles views in different way plain html. honest, i've no idea how big frameworks handling issue because i've worked tiny frameworks, that's why interesting thing me. quick example:

instead of writing

<h2>click on <a href="www.example.com">example</a></h2> 

you'd have type

echo $html->h2('click on this' . $html->link('www.example.com', 'example')); 

so, question 1 better? isn't plain html going faster? , let's more understandable others? or let's leave understandable part away, want know more performance , maybe other stuff people know , can mentioned on issue.

codeigniter 1 of frameworks provides html helper allow generate html through php code (like latter case in question).

while marginally slower, advantage ensures valid html output. take example:

<h2>this header without closing tag

the above common mistake fail silently. however, cannot make same mistake if use html helper function

echo heading('this header',2);

as readability, familiar php should able understand either code fragment little no difficulty.


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -