One very cool feature of the Symfony Workflow Component is the ability to export workflows via graphviz.
Did you know you can also directly render those as PDF files?
Continue reading “Symfony Workflow Component: Dump workflows as PDF”
…dev, tech problems and solutions.
One very cool feature of the Symfony Workflow Component is the ability to export workflows via graphviz.
Did you know you can also directly render those as PDF files?
Continue reading “Symfony Workflow Component: Dump workflows as PDF”
Angular for frontend with symfony delivering the data have become quite a common setup.
When working with this constellation you will sooner or later come across the i18n topic. Most likely you would want to share translations between front- and backend. So that you could keep translations in one single location while using it for frontend templates as well as server-side error messages etc.
One approach would be to store translations in the symfony yml or xml files and deliver those to the frontend via an api endpoint.
Given that front- and backend-code run on the same server, there is an even simpler solution.
Continue reading “Symfony and Angular: shared translations”
Since version 3.1 there is a Cache component with a PSR-6 implementation integrated in Symfony.
So we do not need to add a 3rd party lib as Doctrine Cache anymore when we need caching these days.
Doctrine Cache does the job but by implementing a standard the Symfony Cache seems to have another advantage besides its delievered anyway. So i checked it out.
Documentation is still a bit sparse and the best resource so far is this blogpost:
https://symfony.com/blog/new-in-symfony-3-1-cache-component
I wont go into detail on how you use the Cache but rather how you integrate it with Redis, which is my favourite Cache backend.
Continue reading “Symfony Cache Component with SncRedisBundle”
I recently started to do all PHP development with docker, since I was just tired of installing tons of dev libraries on my machine. Most of which i couldn’t even remember what they actually were good for.
When I first tried docker (docker-toolbox for mac) I was really disappointed how slow symfony apps ran inside the container. Continue reading “Symfony development with docker on a mac”
Update!!
sebastianbergmann/money was abbandonend and the extension was ported to use https://github.com/moneyphp/money instead.
I just released a twig extension for https://github.com/sebastianbergmann/money
The money libary contains a money represention based on the currency’s smallest unit to provide a more accurate handling. See the libary’s readme for more information.
Although the v1.x version of Money brings a Formatter the Twig extension uses its own, which is better suited and more flexible.
Continue reading “Twig Extension for Money value object”Some news from the Superleansilexplate:
docker-compose up
and check on localhost:8088.For creating PHP packages several best practices has been established, like composer support (ofc) and putting the package on packagist, travis integration, directory organisation, tests, documentation and so on.
For further information i recommend these slides https://laravel-news.com/2015/08/hannes-van-de-vreken-package-development-slides/ which describe the situation very well.
And as we are all lazy, we like generators that scaffold a basic php package layout and luckily there are several out there.
They all differ a bit, so pick your favorite.
Continue reading “PHP package generators”
There this really useful tool for JS, called RegExpBuilder.
It enables you to build regular expressions with a nice human-readable & chainable syntax.
(read more about it here and here)
As it’s not that much lines of code, I decided to do a port for PHP – et voila:
https://github.com/gherkins/regexpbuilderphp
Continue reading “RegExpBuilderPHP – PHP Regular Expression Builder”
Using your forks of certain packages with composer is actually pretty easy:
Add the repo of the fork to the repositories block of your composer.json, you might need to change the version to f.e dev-master and thats it. Great. Actually.
"repositories": [ { "type": "vcs", "url": "https://github.com/ivoba/SomeBundle.log" } ]
But there are some traps, especially when you are mentally already weekend bound:
When working in a team, take care that you dont add your fork as a private repo.
This happens when you use the @ notation like ‘git@github.com‘. Its tempting because it will be the clone url on github when you are logged in, which is very likely.
If you do so your team mates will get errors like this:
Failed to execute git clone --no-checkout 'git@github.com:ivoba/SomeBundle.git' [...] && git remote add composer 'git@github.com:ivoba/SomeBundle.git' && git fetch composer
Continue reading “Using forks with composer – late night edition”
Symfony’s ParamConverter is a common way to transform some GET param to an entity before your controllers action.
This happens most of the time via type hinting and priority detection kinda magic in the background.
But as magic is often obscure sometimes you need a bit of explicitness.
F.e. when you have more and different ParamConverter per entity you want to name them explicitly.
Then you can use named ParamConverters.
In the documentation this issue is a bit fragmented, so here is the compact version:
Continue reading “Symfony and named ParamConverters”