devdojo/themes
Composer 安装命令:
composer require devdojo/themes
包简介
This is a themes package for Laravel
README 文档
README
This is a package that will add theme support in your Laravel application
Adding Themes
The themes package will look inside of the resources/themes folder for any folder that has a .json file inside of it with the same name. (You can change the theme folder location in the config)
As an example if you have a folder called sample-theme and inside that folder you have another file called sample-theme.json with the following contents:
{
"name": "Sample Theme",
"version": "1.0"
}
This package will detect this as a new theme. You can also include a sample screenshot of your theme, which would be sample-theme.jpg (800x500px) for best results
In fact, you can checkout the sample-theme repo here: https://github.com/thedevdojo/sample-theme
You can activate this theme by setting the active column to 1 for that specific theme. Then use it like:
return view('theme::welcome')
This will then look in the current active theme folder for a new view called welcome.blade.php :D
Theme Configs
You may choose to publish a config to your project by running:
php artisan vendor:publish
You will want to publish the themes config, and you will now see a new config located at config/themes.php, which will look like the following:
<?php
return [
'folder' => resource_path('themes'),
'publish_assets' => true,
'create_tables' => true
];
Now, you can choose an alternate location for your themes folder. By default this will be put into the resources folder; however, you can change that to any location you would like.
Warning, If you add the themes folder into the
resources/viewsfolder and you runphp artisan optimizeyou may get an error that it cannot find certain components. This is because it will search all the.blade.phpfiles inside the views folder. So, this may not be the best place to put your themes. Instead this package will register only the views of the active theme.
Additionally, you can set publish_assets to true or false, if it is set to true anytime the themes directory is scanned it will publish the assets folder in your theme to the public folder inside a new themes folder. Set this to false and this will no longer happen.
devdojo/themes 适用场景与选型建议
devdojo/themes 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 167.22k 次下载、GitHub Stars 达 21, 最近一次更新时间为 2020 年 03 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 devdojo/themes 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 devdojo/themes 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 167.22k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 21
- 点击次数: 24
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2020-03-30