├── .github └── workflows │ └── release.yml ├── .gitignore ├── CHANGELOG.md ├── README.md ├── composer.json ├── functions.php └── release-please-config.json /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | permissions: 9 | contents: write 10 | pull-requests: write 11 | packages: write 12 | 13 | jobs: 14 | release: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: google-github-actions/release-please-action@v4 18 | with: 19 | release-type: "php" 20 | config-file: release-please-config.json 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | /composer.lock 3 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## [2.0.0](https://github.com/nlemoine/timber-dump-extension/compare/v1.0.0...v2.0.0) (2024-03-08) 4 | 5 | 6 | ### ⚠ BREAKING CHANGES 7 | 8 | * release 2.0 9 | 10 | ### Features 11 | 12 | * release 2.0 ([f3fd31e](https://github.com/nlemoine/timber-dump-extension/commit/f3fd31eb5a10bce468298421e060840a074ee612)) 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Timber Dump Extension 2 | 3 | ![Packagist Downloads](https://img.shields.io/packagist/dt/hellonico/timber-dump-extension) 4 | ![Packagist Version](https://img.shields.io/packagist/v/hellonico/timber-dump-extension) 5 | 6 | Symfony VarDumper for Timber. 7 | 8 | ## Install 9 | 10 | ```bash 11 | composer require hellonico/timber-dump-extension 12 | ``` 13 | 14 | ## Usage 15 | 16 | ```twig 17 | {{ dump(foo) }} 18 | ``` 19 | 20 | Note that this extension will only be enabled if `WP_DEBUG` is set to `true`. 21 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hellonico/timber-dump-extension", 3 | "description": "Provides Symfony VarDumper component for Timber", 4 | "keywords": [ 5 | "timber", 6 | "twig", 7 | "symfony", 8 | "vardumper", 9 | "wordpress" 10 | ], 11 | "license": "GPL-3.0+", 12 | "type": "library", 13 | "authors": [ 14 | { 15 | "name": "Nicolas Lemoine", 16 | "email": "nico@n5s.dev", 17 | "homepage": "https://n5s.dev/" 18 | } 19 | ], 20 | "homepage": "https://github.com/nlemoine/timber-dump-extension", 21 | "require": { 22 | "symfony/twig-bridge": "^6 || ^7", 23 | "symfony/var-dumper": "^6 || ^7", 24 | "wecodemore/wordpress-early-hook": "^1.2" 25 | }, 26 | "autoload": { 27 | "psr-4": { 28 | "HelloNico\\Timber\\": "src/" 29 | }, 30 | "files": [ 31 | "functions.php" 32 | ] 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /functions.php: -------------------------------------------------------------------------------- 1 | addExtension(new DumpExtension(new VarCloner())); 14 | } 15 | return $twig; 16 | } 17 | earlyAddFilter('timber/loader/twig', sprintf('%s\\add_dump_extension', __NAMESPACE__)); 18 | -------------------------------------------------------------------------------- /release-please-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": { 3 | ".": { 4 | "release-type": "php", 5 | "include-v-in-tag": false 6 | } 7 | }, 8 | "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" 9 | } 10 | --------------------------------------------------------------------------------