vahadigital / pimcore-project-info-bundle
Pimcore bundle for displaying project information from environment variables
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:pimcore-bundle
Requires
- php: >=8.1
- pimcore/pimcore: ^11.0
- twig/twig: ^3.0
This package is not auto-updated.
Last update: 2025-08-18 17:19:15 UTC
README
A Pimcore 11+ bundle that provides project information from environment variables through Twig functions.
Features
- 🏷️ Display project name from
PROJECT_NAME
environment variable - 🌍 Show environment information (
APP_ENV
) - 🔄 Automatic environment display (adds environment to name if not production)
- 🎨 Easy Twig integration with custom functions
- ⚡ Self-configuring services (no manual setup required)
Installation
Install:
composer require vahadigital/pimcore-project-info-bundle
Enable the Bundle
Add the bundle to your config/bundles.php
:
<?php return [ // ... other bundles VahaDigital\ProjectInfoBundle\ProjectInfoBundle::class => ['all' => true], ];
Note: The bundle automatically registers its services via DependencyInjection
. No manual service configuration needed!
3. Clear Cache
php bin/console cache:clear
Environment Variables
Set these variables in your .env
file:
PROJECT_NAME=My Awesome Project APP_ENV=dev
Usage in Twig Templates
Basic Functions
{# Get project name #} {{ project_name() }} {# Get display name (includes environment if not prod) #} {{ project_display_name() }} {# Get all project info as array #} {% set info = project_info() %}
Complete Example
<!DOCTYPE html> <html> <head> <title>{{ project_display_name() }}</title> </head> <body> <h1>{{ project_name() }}</h1> {% set info = project_info() %} <div class="project-info"> <p>Environment: {{ info.environment }}</p> {% if info.is_development %} <div class="dev-warning">Development Mode</div> {% endif %} </div> </body> </html>
Available Functions
Function | Description | Example Output |
---|---|---|
project_name() |
Raw project name from env | "My Project" |
project_display_name() |
Name with env (if not prod) | "My Project (DEV)" |
project_info() |
Complete info array | See below |
Project Info Array Structure
[ 'name' => 'My Awesome Project', 'environment' => 'dev', 'display_name' => 'My Awesome Project (DEV)', 'is_production' => false, 'is_development' => true, ]
Development
Bundle Structure
pimcore-project-info-bundle/
├── src/
│ ├── ProjectInfoBundle.php # Main bundle class
│ ├── Service/
│ │ └── ProjectInfoService.php # Core logic
│ └── Twig/
│ └── ProjectInfoExtension.php # Twig functions
├── composer.json # Package definition
└── README.md # This file
Requirements
- PHP 8.1+
- Pimcore 11.0+
- Twig 3.0+
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
Support
- 🐛 Issues: GitHub Issues
- 📧 Email: dev@vahadigital.com
- 🌐 Website: Vaha Digital
Changelog
v1.0.0
- Initial release
- Project name and environment display
- Twig functions:
project_name()
,project_display_name()
,project_info()
- Automatic service configuration
License
MIT License - see LICENSE file for details.