Symfony 3 with ReactJS and Angular
In this series we are going to look at how we can use Symfony 3 as the foundation for a simple Create Read Update Delete (CRUD) application, using Blog Posts as our example data set.
To begin with we will take a quick look at how we can use Twig to very quickly build out the required code and templates to display the appropriate forms, lists / tables, and buttons to make the page(s) behave as expected.
Throughout this series I am going to assume you have either watched the following courses:
- Beginner's Guide To Symfony 3
- Beginner's Guide To Doctrine with Symfony 3
- Beginner's Guide to Forms with Symfony 3
Or that you have the equivalent knowledge.
Once we have seen how quickly we can create a CRUD layout when using Symfony with Twig, we will switch up and make things a little more 'modern'.
I mean no disrespect to Twig by this. I frequently use Twig to create smaller scale sites where dynamic elements are either not required at all, or will not be required in this iteration. There are several reasons for this, but it largely comes down to: Simplicity.
The 'problem' with the RESTful API approach is simply that you will likely end up with two codebases to support.
Firstly, you will create your Symfony project with all your API logic, and then secondly, likely a separate project for your Angular, React, Ember, mobile, or whatever front-end you wish to put over your API.
However, this way is "the future".
The good news here is that everything you have learned about Symfony (be it Symfony 2 or Symfony 3) is going to be directly applicable moving forwards.
The tricky part comes in that now you have to work with your data in a format which 'feels' more raw. You will spend your time dealing with JSON representations of your data.
Anyway, enough pre-amble, let's get coding!