Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add twig functions #9

Open
tacman opened this issue Dec 4, 2024 · 1 comment
Open

Add twig functions #9

tacman opened this issue Dec 4, 2024 · 1 comment

Comments

@tacman
Copy link

tacman commented Dec 4, 2024

I'd like to access the version information from twig, the 3 variables injected into the DI, since I almost always want to show the version info somewhere on the site, like the footer or an about page.

application.version - the application's version (the format depends on the configured versioning strategy)
application.version_hash - an MD5 digest of the version
application.release_date - an [RFC 3339](https://tools.ietf.org/html/rfc3339) formatted date on which the version was last incremented
<footer>{{ app.name }} {{ version() }} {{ version_hash() }} {{ version.release_date() }} </footer>

They could also be injected as twig globals.

AbstractBundle makes this kind of stuff easier, but it's Symfony 6.4+ only.

(Okay, I'll stop with the issues! I'm just kinda excited about using this...)

@tacman
Copy link
Author

tacman commented Dec 4, 2024

Actually, I'd like a 'application' to contain more than the version info, I'd like to it contain name, code, github repo, etc. That's above and beyond this bundle, but I noticed that the prefix is bizkit, and I wonder if you had ideas for including more than just versioning. Since you're already tightly tied with the versioning system, I'd love to have the name (the "name" property in composer.json) and branch also injected into the DI. And a link to the github repo.

Above and beyond this bundle, but just brainstorming about things I'm looking at when adding the version to the applications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant