intentor/laravel-theme
Composer 安装命令:
composer require intentor/laravel-theme
包简介
Simple theme manager for Laravel 5.
README 文档
README
Simple theme manager for Laravel 5
Currently the project is DISCONTINUED. However, feel free to fork it and continue its development!
Contents
Introduction
Laravel Theme provides a simple way to manage themes on a Laravel app.
Compatible with Laravel 5.
Installation
Laravel 5.0
At composer.json of your Laravel installation, add the following require line:
{
"require": {
"intentor/laravel-theme": "~1.0"
}
}
Run composer update to add the package to your Laravel app.
At config/app.php, add the Service Provider and the Facade:
'providers' => [ 'Intentor\LaravelTheme\ServiceProvider', ] //... 'aliases' => [ 'Form' => 'Intentor\LaravelTheme\Facade', ]
Laravel 5.1+
At composer.json of your Laravel installation, add the following require line:
{
"require": {
"intentor/laravel-theme": "~1.0"
}
}
Run composer update to add the package to your Laravel app.
At config/app.php, add the Service Provider and the Facade:
'providers' => [ Intentor\LaravelTheme\ServiceProvider::class, ] //... 'aliases' => [ 'Form' => Intentor\LaravelTheme\Facade::class, ]
Quick start
Creating a theme
To create a theme, first add a themes folder to the resources folder of your app.
Inside the themes folder, any folder you create will represent a theme. For each theme folder, add a views folder, in which you'll create all the views for that particular theme.
The folder structure will look like this:
resources
└── themes
├── [theme folder]
| └── views
|
└── [another theme folder]
└── views
Setting a theme
To set a theme, call Theme::set('theme_name') anywhere you want to change your theme.
Remember: the name of theme is the name of the folder that represents the theme at the resources/themes folder.
Displaying views
To display a view, just call view('view_name') without indicating any reference to the theme.
Adding assets
To add assets to pages, just include them pointing to their location at the public folder.
Best practices
1. Add any assets (images, CSS, JS, etc.) for the theme in a specific folder inside the public folder.
2. If you're using a task manager (like Gulp or Grunt) it's recommended to add assets at an assets folder inside the theme and then move the files to the public location.
resources
└── themes
├── [theme folder]
| ├── css/sass/less
| ├── img
| ├── js
| └── views
|
└── [another theme folder]
├── css/sass/less
├── img
├── js
└── views
3. Create shared views at the resources/views folder.
4. Views in themes always override shared views.
Limitations
- Asset management can be rather awkward, given the views for the theme are outside the
publicfolder.
Changelog
Please see CHANGELOG.md.
Support
Found a bug? Please create an issue on the GitHub project page or send a pull request if you have a fix or extension.
You can also send me a message at support@intentor.com.br to discuss more obscure matters about the component.
License
Licensed under the The MIT License (MIT). Please see LICENSE for more information.
intentor/laravel-theme 适用场景与选型建议
intentor/laravel-theme 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 247 次下载、GitHub Stars 达 10, 最近一次更新时间为 2015 年 03 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「assets」 「theme」 「template」 「view」 「blade」 「laravel-5」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 intentor/laravel-theme 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 intentor/laravel-theme 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 intentor/laravel-theme 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Asset Management for PHP
Caching and compression for Twig assets (JavaScript and CSS).
A Bootstrap 4.x base theme for SilverStripe
Tool for loading or deploying CSS and JS files into web pages
Lucency Theme
Simple ASCII output of array data
统计信息
- 总下载量: 247
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 11
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-03-18