Seo Forum

Coding & Programming => PHP Forum => Topic started by: imobdevtech on 12-07-2014, 23:51:03

Title: PHP responsive web template
Post by: imobdevtech on 12-07-2014, 23:51:03
I would like to get PHP responsive website templates for PHP web development.
If anyone has good sources, I request you to share some sources here.
Title: Re: PHP responsive web template
Post by: xerbotdev on 02-18-2015, 03:55:32
PHP has makes it very easy to write templates, and thereby remove business logic from the display of the information.

The way I personally do it is by doing ALL the logic before getting to the display part. The logic would then create a global variable $DATA which is an associative array that contains all the data for the template.

At the end of the logic phase, I then include the proper templates for the page that I need to display. I include for instance, the default template which includes 3 sub-templates based on $DATA['template_header'], $DATA['template_main'], $DATA['template_footer'] . Like this I am able to clearly separate business logic from the view, and also change the header, content and the footer of every page dynamically.