How can we separate Logic from presentation without using any template engine (traditional php-not OOP)
Thank in advance
How can we separate Logic from presentation without using any template engine (traditional php-not
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
Why not to use PHP itself as a template engine? It being used in the code I posted for your other question. Your program has to be split into 2 main sections: getting data and displaying data.
Each page have to have it’s own template. In the code I posted there is 2 very simple templates,
form.phpandlist.phpjust extend it with the whole site template, And you have done!
Here is a little more complex PHP template example:
And it is called like this
Looks magnificent to me!
Dunno though, if it’s what you’re asking for 🙂