How can I convert a HTML template into a live php-editable template? I’d like to be able to set the title, description, add images and links. (something like the behance uploading system)
Can someone link me to a tutorial?
Thanks a lot!
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.
To do this in a simple way, you should follow this 3 steps :
1- Add custom tags in your HTML template
2- Create a class to make your HTML template writable
3- Load the class, write your template, display the page
First, insert some custom tags in your HTML template (template.html), like this :
Then, create a quick class (class.php) to make your custom tags writable :
Once this is done, you must create a function to write inside your tags. In my example, to be able to write your
<page_title>tag, add the following code to your class.php file :Something like :
writetitle now acts as an echo, so you can make queries and everything you want.
In the end you have 3 files :
tempalte.html : your template
class.php : your template engine
page.php : an example page usging your template.
hope it helps. 😉