Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shapecode/theme-bundle
https://github.com/shapecode/theme-bundle
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/shapecode/theme-bundle
- Owner: shapecode
- License: mit
- Created: 2018-02-21T12:46:39.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-07-22T08:36:28.000Z (over 5 years ago)
- Last Synced: 2024-03-27T08:01:12.705Z (8 months ago)
- Language: PHP
- Size: 18.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Theme Bundle
============This bundle provides you the possibility to add themes to each bundle. In your
bundle directory it will look under `Resources/themes/` or fall back
to the normal Resources/views if no matching file was found.## Installation
Installation is a quick (I promise!) 3 step process:
1. Download ShapecodeThemeBundle
2. Enable the Bundle### Step 1: Install ShapecodeThemeBundle with composer
Run the following composer require command:
``` bash
$ php composer.phar require shapecode/theme-bundle```
### Step 2: Enable the bundle
Finally, enable the bundle in the kernel:
``` php
Placeholder
Representation
Example
%app_path%
Path where application resources are located
app/Resources
%bundle_path%
Path where bundle located, for example
src/Vendor/CoolBundle/VendorCoolBundle
%bundle_name%
Name of the bundle
VendorCoolBundle
%dir%
Directory, where resource should looking first
%current_theme%
Name of the current active theme
%template%
Template name
view.html.twig
%override_path%
Like template, but with views directory
views/list.html.twig
### Change Active Theme
For that matter have a look at the ThemeRequestListener.
If you are early in the request cycle and no template has been rendered you
can still change the theme without problems. For this the theme service
exists at:``` php
$activeTheme = $container->get('shapecode_theme.active_theme');
echo $activeTheme->getName();
$activeTheme->setName("phone");
```## Contribution
Active contribution and patches are very welcome.
First install dependencies:
```bash
composer.phar install --dev
```