Category: Software Development
-
Php Backed Enums don’t forget to call value
The one thing I don’t like about new PHP enums is, if you forget to call ->value you get exceptions “object can’t be converted to string” It is entirely too easy to forget to call ->value. This means in places where I refactor code I have to remember to call ->value. Hence the article title […]
-
Symfony 5+ Twig templates don’t forget to call the parent
Twig templates use inheritance and allows you to create named sections like this. <!doctype html> <html lang=”en”> <head> <meta charset=”UTF-8″> <meta name=”viewport” content=”width=device-width, initial-scale=1, shrink-to-fit=no”> <link rel=’icon’ href=”{{ asset(‘images/favicon.ico’) }}” type=’image/x-icon’ > {% block head_extra %}{% endblock %} <title>{% block title %}{{ title }}{% endblock %}</title> {% block stylesheets %} {# ‘app’ must match the […]
-
How to list all stopped and running Docker containers
I often need to do this but forget exactly how to do this. I don’t know if this has changed. I could swear it has changed. You will probably find crap all over the internet telling you to use docker ps But that only lists running containers. Same story for docker container ls So how […]
-
How to create 100+ Symfony 5+ Doctrine 2 or 3 Repositories
Scroll to the bottom to view a video of this Repository maker in action. I make about 100 Repositories in less than 2 minutes. You can go faster by just hitting enter really fast. LOL NOTE – repository in the sense of this article means a Doctrine Repository Object. This object is used to interact […]
-
How to install Redis with Docker for local testing
In another article I suggest installing Redis with docker but do not tell how. In this article I cover how to get a Redis Image up and running with Docker locally. First you need to install Docker for your system. After you have Docker installed, next you need to download a Redis image. Here is […]
-
Tips and tricks to reverse engineer your existing database with Doctrine for Symfony
So in the Symfony documentation there is a page that describes how to reverse engineer an existing database using Doctrine. Rule #1 No DB Vendor custom types The only problem is this technique will only work with databases that are generically designed. Meaning you can’t use some of the DB vendor specific types etc. This […]
-
How to fix Unknown database type enum requested, Doctrine\DBAL\Platforms\MySQL80Platform may not support it.
So you got this lovely error when trying to reverse engineer a database with doctrine. This error means that your database uses ENUM and is probably running on MySQL. MySQL also contains SET which is about the same as ENUM except enum allows only 1 value from the list( or empty string or NULL) and […]
-
How to reverse engineer a database for a symfony project with doctrine… aka t_
TLDR This is a parody about how I learned to Reverse engineer a Database for a Symfony App with Doctrine. Here is a short article including tips and tricks I discovered I learned while writing this. This article jokes about some of what I ran into and what I was thinking while I learned Doctrine. […]
-
How to quickly create a complete Symfony 5+ app with login and password reset
If you follow this quick guide you should be able to have a simple, yet complete Symfony 5.xx ( or 6 soon ) . There are lots and lots of baby steps. If you want to know how all of this works and much more I suggest reading this excellent article. This is meant to […]
-
Symfony 5+ how to create a Maker
The docs do not mention how to create your own maker bundle. It gives a link to some of the Github code of the existing maker bundles for you to view as an example. So when I dug deeper into the subject, I figured out what you are actually doing with a maker is creating […]