I have a relatively simple application up and working with some basic functionality which i have built as a bit of a project. I would like to now build on that, and add some more complex features, including login.
The code has got quite complex, and it's written in plain php, so all the presentation code is mixed in with the logic. I have decided that before I go any further I'd like to re factor it to separate this out, so it's easier to maintain and add to. I've been researching MVC and think that's the way i should be going.
I had decided to give the zend framework a go, and have spent a while trying to get to grips with it, however I have found the learning curve extremely steep as I have no object oriented experience.
Is there another framework or option that anyone could recommend? I am considering having a look at cake based on reading other posts in this forum but I'd accept any guidance - my "requirments" are
All suggestions appreciated!
PHP is not a template engine, but a language that can be used to write templates, or template engines. A template engine is not just a language, but also the programming API that allows the scripts to locate, organize templates or assign the data from the script to them.
Popular template engines Template engines are mostly used for server-side applications that are run on only one server and are not built as APIs. The popular ones include Ejs, Jade, Pug, Mustache, HandlebarsJS, Jinja2, and Blade.
Smarty. Smarty is a template engine for PHP, facilitating the separation of presentation (HTML/CSS) from application logic. This implies that PHP code is application logic, and is separated from the presentation. Under the hood, Smarty compiles copies of the templates as PHP scripts.
Spring MVC, Struts or Apache Wicket are examples of web frameworks, whereas JSP, Velocity or FreeMarker are examples of template engines.
As stated very eloquently here already, frameworks are good until you want to do something they're not suited for, plus they can abstract the language to the point where you're effectively learning them rather than the language you're coding in.
I would encourage you to roll your own. If you understand the principles of MVC and you have a fair-to-middling knowledge of PHP then it won't be too hard (there's already several pointers around), plus you'll come out of it far further ahead than if you'd just used someone else's.
Smarty templating engine.
http://www.smarty.net/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With