我如何使用 smarty 将主题从父域加载到子域?
我的父域上有一个默认主题文件夹,例如 foo.bar/themes/default/
当用户注册时,我会为它们创建一个子域,例如 bob.foo.bar
> 我如何从逻辑上指向我的父域上的默认主题文件夹?我的想法是,如果他们选择有一个自定义主题,则将该主题上传到他们的子域文件夹,然后让 smarty 指向它。
我知道如何执行此操作,如果且仅当我可以通过 PHP 控制子域时。但现在在 cPanel 中,当创建子域时,它会生成 vhosts 文件,以便它直接进入它们的 document_root,绕过我的任何 PHP 脚本,这些脚本将控制 smarty 主题路径的处理方式。
对此有什么好的解决方案吗?
I have a default themes folder on my parent domain such as foo.bar/themes/default/
when a user registers i make a sub domain for them like bob.foo.bar
how can I logically point to the default themes folder on my parent domain? My idea is that if they choose to have a custom theme for that theme to be uploaded to their sub domain folder and then have smarty point to it.
I know how to do this IF and only IF I have control over sub domain via PHP. But right now in cPanel when a sub domain is made it makes the vhosts files so that it goes directly to their document_root bypassing any of my PHP scripts that would control how the smarty theme paths are handled.
What would be a good solution for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果是 Linux 系统,您可以编写一个脚本来创建默认主题的链接。
if its a linux system, you could just make a script that creates links to the default theme.