├── .editorconfig ├── LICENSE ├── README.md ├── composer.json ├── digster.php └── src ├── api.php ├── cache └── class-wordpress-cache-adapter.php ├── class-digster.php ├── class-factory.php ├── class-view.php ├── engines ├── class-engine.php └── class-twig-engine.php ├── extensions ├── class-filter-extensions.php ├── class-function-extensions.php ├── class-global-extensions.php └── class-i18n-extensions.php ├── helpers.php ├── nodes └── class-trans.php ├── token-parsers └── class-trans.php └── views └── error.php /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.php] 12 | indent_style = tab 13 | indent_size = 4 14 | 15 | [*.md] 16 | trim_trailing_whitespace = false 17 | 18 | [Makefile] 19 | indent_style = tab 20 | indent_size = 8 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015-2016 Fredrik Forsmo 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Digster 2 | 3 | [](https://travis-ci.org/wpup/digster) 4 | [](http://unmaintained.tech/) 5 | 6 | > Twig templates for WordPress 7 | 8 | Digster it's a WordPress plugin that allows you to render Twig views with a 9 | few Twig [filters](#twig-filters), [functions](#twig-functions) and [globals](#twig-globals). 10 | 11 | It's easy to register your own [extensions](#register-extension) or [composers](#register-composer). 12 | 13 | ## Install 14 | 15 | ``` 16 | composer require frozzare/digster 17 | ``` 18 | 19 | ## Example 20 | 21 | Example of `page.php` 22 | 23 | ```php 24 | /** 25 | * Render page view. 26 | */ 27 | echo view( 'page' ); 28 | ``` 29 | 30 | Example of `page.twig` 31 | 32 | ```jinja 33 | {% include "partials/header.twig" %} 34 |
%s
', $message ); 109 | } 110 | ?> 111 |%s
', $code );
115 | }
116 | ?>
117 |
118 |
119 |
--------------------------------------------------------------------------------