cheslijones
cheslijones

Reputation: 9194

Design Pattern for PHP that uses 3rd Party Template Engine

I am familiar with the MVC design pattern, but I am curious what pattern this would be considered.

A project I am looking at uses the Tiny but Strong (TBS) template engine and PHP for the back-end. For every PHP file there is a TBS template. The PHP is not OOP, nor employs any functions, so looks just procedural. (It sucks as I have been tasked with updating it and there is duplicate code in every single file... there is like 100 files).The PHP files do both the communicating with the database and dictating which TBS template to use.

Would it just be MV, CV, or is it just procedural PHP with a template engine?

Upvotes: 0

Views: 111

Answers (1)

pacificpelican
pacificpelican

Reputation: 363

MVC (model view controller) is about separation of concerns. Models will typically handle data, controllers will add logic and views lay out how things should look. Consider that generally MVC frameworks use different files/directories for a model than a controller or a view.

In what you are describing, the data is fetched on the same page that it is handled and laid out on--so as far a I can tell, it is not separating concerns at all.

Maybe "procedural PHP with a template engine" could work as a description but you might also call it a bunch of templates with queries and repeated code in them.

Upvotes: 1

Related Questions