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 157553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:31:28+00:00 2026-05-11T10:31:28+00:00

All the popular PHP frameworks today use their own view layer implementation that is

  • 0

All the popular PHP frameworks today use their own view layer implementation that is based on pure PHP templates and lots of helpers. I’ve tried some of them and always found that this approach introduced huge complications to quite simple things. For example, in Zend Framework forms and the pagination use their own solutions to customize the look of these items. The helpers re-invent loops, providing also quite slow solutions, and the whole view layer, in my opinion does not exist as a one part, but many of its functionality is delegated to other parts of the script. The same configuration problems occured in Symfony and admin generator, and in Kohana I was forced to duplicate the same code over all my forms. Is PHP really a good choice for the view layer? Do you also find these implementations inconvenient or maybe, why despite all these problems they are good and cannot be replaced, for example by a smart template engine (I don’t mean Smarty :))?

  • 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-11T10:31:29+00:00Added an answer on May 11, 2026 at 10:31 am

    Now I like PHP but ultimately, first and foremost, it is a templating language, not a general purpose programming language nor an object-oriented language. Don’t fight it. Embrace it.

    I’ve looked at a few different MVC frameworks like Symfony, CakePHP and Zend and I have a hard time getting past the examples. Typically they are ‘with these 17 files you can make a ‘Hello world’ program!’ Huh?!?!

    There is such a thing as complexity for sake of it and solving a problem before you have a problem and I’m yet to be convinced that these heavyweight (they are heavyweight) frameworks really adds value.

    I’m more of a fan of the ‘no framework’ framework. This is really ‘roll your own’ but I think that it leads to the leanest, cleanest end result.

    I feel similarly about Smarty. A lot of people on SO are big fans of Smarty but it’s never made sense to me why you’d add a templating language to your… templating language.

    Ultimately I end up writing this kind of PHP script most of the time

    <? require 'config.h'; // set up constants, DB connections and so on page_header('My Page'); // page header, site menu and so on deny_unregistered(); // security if (/* user submitted page */) {   $valid = validate_form(/* validation rules */);   if ($valid === true) {     // do db changes     // redirect user ie POST+REDIRECT+GET   } else {     // output error messages   } } ?> // display page <? page_footer(); ?> 

    With judicious use of helper functions (eg pagination links), the above is incredibly easy to read and debug. I also much prefer it to this model:

    URL: /index.php?inc=blah

    index.php:

    <? require '$inc.php'; // hopefully you sanitize this but so many don't ?> 

    I find this ugly, error-prone and even dangerous. I have a hierarchy of PHP files that mirrors the site structure (from a menu point of view) where each page is a PHP script. If they have common behaviour they both require it (not require_once, which is typically used as a hack for poor organisation).

    Simple, easy, understandable, straightforward.

    It seems a lot of programmers will throw a framework into the mix before there is really ever any need. I think this is a fairly lazy practice and one with a big cost: every decision made today is one that becomes harder to change later so put off making decisions like this as long as possible. Introducing something later is easier than introducing something now, finding out it doesn’t really do what you want and then changing it later.

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

Sidebar

Ask A Question

Stats

  • Questions 70k
  • Answers 70k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer UPDATE table SET status = 1 WHERE status = 2… May 11, 2026 at 12:54 pm
  • added an answer My advice - don't do it. Only even consider 3.0… May 11, 2026 at 12:54 pm
  • added an answer There is no single answer, it depends on your scenario,… May 11, 2026 at 12:54 pm

Related Questions

Print all 12 verses of the popular holiday song . By 12 verses I
All the articles I've found via google are either obsolete or contradict one another.
All the recent VisualSVN Server posts made me want to check it out. I
All the googling around hasn't found an answer for me yet... I have one
All the examples I see are for Java SE applications by passing your JAR
Recently thanks to rails' popularity, many people start using activerecord as model. however, before
One of the things mentioned recently maybe in the SO podcast or Joel was
I wanted to emulate a popular flash game, Chrontron, in C++ and needed some
Before you answer this I have never developed anything popular enough to attain high

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.