_Unique_ Posted July 1, 2015 Share Posted July 1, 2015 Hello, I am currently working on a project. I am wanting to implement a theme/template system, where the user can install themes/templates which will upload the folder/files into the theme folder where the website will scan all directories inside the theme folder and list all directories found, as themes. However, I cannot figure out how I can go about creating this. I am really confused, especially as I have tried countless times attempting to organize and plan the system in my head in the past couple of weeks. Could someone please explain to me, how I could go about doing this? As I said before, I already tried to have the name of the main theme in the database, where I would retrieve that name of the theme via a query. But then I couldn't figure out how I could link all the stylesheets that was in the theme folder. (If that makes sense, unfortunately I am so confused, that nothing is currently making sense - if that makes sense..) Anyway, I pretty much need to figure this out, with some help from you Thanks in advance, Unique Quote Link to comment https://forums.phpfreaks.com/topic/297128-creating-a-themetemplate-system/ Share on other sites More sharing options...
maxxd Posted July 1, 2015 Share Posted July 1, 2015 In this situation, I'd recommend using a templating system such as Twig. Assuming you have a constant base themes directory, so you can store the current template directory name in the database, grab that value, append it to the base theme directory path, and feed that to the Twig_Loader_Filesystem() constructor for use in rendering. Quote Link to comment https://forums.phpfreaks.com/topic/297128-creating-a-themetemplate-system/#findComment-1515350 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.