Answer the question
In order to leave comments, you need to log in
How to pull the layout on the smarty engine?
Hello!
There is a standard layout with index.html files, styles, pictures and a couple of js scripts.
The tasks are as follows:
You need to transfer the site to the Smarty engine, and then add the admin part (directly using the server and php).
How can this be done? It's not entirely clear how to pull the layout on a template engine, I hope someone will tell you how to do it for a teapot) I'm doing it for
the first time, so it's not boom-boom, before that I only made up sites.
Answer the question
In order to leave comments, you need to log in
To get started, just break all your files into 3 parts: header, content, footer - create 3 *.tpl files and put each of the parts there.
In the backend, you need some method of the render type (if the engine is self-written), to which the name of the template (main) is passed, and it itself connects the header / footer before and after, respectively, and connects the template in the middle.
Further, it is already possible to break each page (each semantic template) into blocks that can be reused in other templates, and also put these blocks into separate templates, and then connect them using {include file=""}
All that remains is in the render method, pass dynamic data to the template, in the case of smarty, assign before rendering.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question