Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 34803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T14:08:09+00:00 2026-05-10T14:08:09+00:00

I seem right now to be embroiled in a debate with another programmer on

  • 0

I seem right now to be embroiled in a debate with another programmer on this project who thinks that views have no merits. He proposes a system that PHP looks something like this:

$draw = new Draw; $nav = $draw->wideHeaderBox(). $draw->left().     $draw->image().         Image::get($image,60,array('id'=>'header_image')).     $draw->imageEnd(). $draw->leftEnd(). $draw->left(10).     '<div id='header_text'>'.         self::defaultSectionText().     '</div>'. $draw->leftEnd(). 

and so on (this is in the controller btw). Now his arguments for this actually make some sense, he claims that if there is a redesign all we need to do is change the HTML in one place and it changes everywhere automatically. For some reason however, this method still rubs me the wrong way, is there any merit to views over this method? I mean besides not having to retype HTML by hand.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T14:08:10+00:00Added an answer on May 10, 2026 at 2:08 pm

    HTML time-savers are useful, but they’re only useful when they’re intuitive and easy-to-understand. Having to instantiate a new Draw just doesn’t sound very natural. Furthermore, wideHeaderBox and left will only have significance to someone who intimately knows the system. And what if there is a redesign, like your co-worker muses? What if the wideHeaderBox becomes very narrow? Will you change the markup (and styles, presumable) generated by the PHP method but leave a very inaccurate method name to call the code?

    If you guys just have to use HTML generation, you should use it interspersed in view files, and you should use it where it’s really necessary/useful, such as something like this:

    HTML::link('Wikipedia', 'http://en.wikipedia.org'); HTML::bulleted_list(array(     HTML::list_item('Dogs'),     HTML::list_item('Cats'),     HTML::list_item('Armadillos') )); 

    In the above example, the method names actually make sense to people who aren’t familiar with your system. They’ll also make more sense to you guys when you go back into a seldom-visited file and wonder what the heck you were doing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to detect strings that have non-whitespace characters in them. Right now
I would have thought that this would be an easy thing to do, but
I have a scenario that looks like this: User A is a registered user.
Right now I am porting a VB6 project over to C# and keep getting
This is driving me nuts! A little piece of code that I can't seem
can't seem to get the syntax right in order to pass the AttID variable.
Seem to be having an issue with std::auto_ptr and assignment, such that the object
I seem to make this mistake every time I set up a new development
I seem to always have problems with converting data to and from XML in
There seem to many ways to skin this particular cat - but which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.