Home  >  Article  >  Backend Development  >  laravel编写的blog cms 如何优雅的切换主题

laravel编写的blog cms 如何优雅的切换主题

WBOY
WBOYOriginal
2016-06-06 20:17:231549browse

问题:大家在用laravel编写blog或者cms的时候,如果遇到多个主题,是如果设计优雅的切换,和为后期增加主题留下空间.

回复内容:

问题:大家在用laravel编写blog或者cms的时候,如果遇到多个主题,是如果设计优雅的切换,和为后期增加主题留下空间.

将视图文件存在views下不同的文件夹,
eg:

  1. /views/default

  2. /views/blue

before检测,赋值$theme

return View::make($theme.'dir.page')


一个laravel theme包:https://github.com/teepluss/laravel-theme

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn