https://github.com/davidjeddy/yii2-pieces-theme
https://github.com/davidjeddy/yii2-pieces-theme
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/davidjeddy/yii2-pieces-theme
- Owner: davidjeddy
- License: mit
- Created: 2015-10-18T22:58:57.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-01-04T03:42:19.000Z (over 3 years ago)
- Last Synced: 2025-01-16T11:32:48.438Z (5 months ago)
- Language: PHP
- Size: 7.68 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Yii2 Pieces Compendium Theme
## About
Yii2 Custom Theme for pieces-compendium.com## Badges
--need SensioLabs tests setup--
[](https://packagist.org/packages/davidjeddy/yii2-pieces-them)
[](https://packagist.org/packages/davidjeddy/yii2-pieces-them)
[](https://packagist.org/packages/davidjeddy/yii2-pieces-them)
[](https://packagist.org/packages/davidjeddy/yii2-pieces-them)
[](https://packagist.org/packages/davidjeddy/yii2-pieces-them)
[](https://packagist.org/packages/davidjeddy/yii2-pieces-them)## Credit
Based on [https://github.com/sheillendra/yii2-theme](https://github.com/sheillendra/yii2-theme).## Installing
- Run `php composer.phar require davidjeddy/yii2-pieces-theme` on the terminal in your {project root}
- Or add `"davidjeddy/yii2-pieces-theme": "^2"` to your projects composer.json in the "required": [...] section,
then execute a `php composer.phar update -o` command.Next edit /application/root/path.env (or create if one does not exist). Edit the proper values for `STORAGE_HOST_INFO`.
Example: `STORAGE_HOST_INFO = https://storage.pieces-compendium.`Then edit the applications ./config/web.php (or similar):
```
'components' => [
...
'assetManager' => ['linkAssets' => true],
'view' => [
'theme' => [
'pathMap' => [
'@app/views' => '@vendor/davidjeddy/yii2-pieces-theme/src/views',
],
],
],
...
],
```# Structure:
```
backend/
...
views/
web/
...
themes/
themes_1/
assets/
views/
layout/
controller_name/
...
themes_2/
themes_3/
```# Usage
In your application's view layout file, initialize the theme.```
public function init()
{
parent::init();
\Yii::$app->view->theme->pathMap[your_module_name.'/views'] = [your_module_name.'/themes/'.\Yii::$app->view->theme->active.'/views'];
// custom initialization code goes here
}
```