Practical Symfony
Practical Symfony
Step-by-step guide to create a simple CMS in Symfony 3
About the Book
Having worked with many PHP Frameworks in the past, I feel that Symfony is one of the more mature and beautiful Web Framework today. Even many popular frameworks like Laravel and Drupal use Symfony components. I used Symfony in many big projects and have never looked back. If you are looking to learn a new PHP Framework, look no further because Symfony forces you to do the right things and gives you a solid foundation to further develop your Object Oriented skills.
The official documentation at Symfony website is fantastic but building something by simply reading the documentation is not enough. How do you even start?
This book aims to lower the learning curve by providing a step by step hand holding approach to build SongBird - a simple CMS. Hopefully after following all the chapters, your eyes will be opened to RAD and the unlimited possibilities with Symfony.
Chapters Overview
Chapter 1: Survival Skills
A quick introduction to the skills required to learn Symfony.
Chapter 2: What is SongBird
Introduction to what Songbird is and isn't.
Chapter 3: Creating the Dev Environment
Installing Songbird using docker. Docker is fantastic but its a shame that mac users need a work around at the time of writing.
Chapter 4: The Testing Framework Part 1 (Optional)
Introduces and Installing Codeception for Behavioural Testing.
Chapter 5: The Testing Framework Part 2 (Optional)
Writing a sample BDD acceptance test.
Chapter 6: The User Management System Part 1
Introduces and Installing FOSUserBundle for User Management.
Chapter 7: The User Management System Part 2
Generating user CRUD using the command line and a bit of doctrine appetizer.
Chapter 8: Doctrine Fixtures and Migrations
Installing and running Doctrine Fixtures and Migrations. It is important to have a consistent way of creating test data and migrating schemas.
Chapter 9: The Admin Panel Part 1
Installing EasyAdminBundle and integrating it with FOSUserBundle.
Chapter 10: BDD With Codeception (Optional)
Writing BDD acceptance tests for user management business rules.
Chapter 11: Customising the Login Process
Customising Twig templates for the login and request password pages.
Chapter 12: The Admin Panel Part 2
Tweaking EasyAdmin UI.
Chapter 13: Internalisation
Getting Songbird to support french as well.
Chapter 14: Uploading Files
Installing VichUploaderBundle and integrating it with EasyAdminBundle.
Chapter 15: Logging User Activities
Creating a simple bundle to log user activities.
Chapter 16: Improving Performance and Troubleshooting
Installing blackfire and improving Symfony performance. Introduces Gulp to manage all frontend assets.
Chapter 17: The Page Manager Part 1
Creating a custom bundle called NestablePageBundle to manage pages. Introduces PHPUnit to write functional tests.
Chapter 18: Making Your Bundle Reusable
Refactoring NestablePageBundle and making it as a separate installable component.
Chapter 19: The Page Manager Part 2
Installing CKEditor to the CMS and creating a custom locale selector.
Chapter 20: The Front View
Creating the frontend controller and view.
Chapter 21: Dependency Injection Revisited
Using Compiler Pass to add user roles to EasyAdminBundle.
Chapter Final
Congratulations. It's time to start build something yourself using Symfony.
Table of Contents
- Preface
-
Introduction
- Audience
- Why Re-invent the Wheel?
- Is SongBird Reusable?
- Chapters Overview
- Conventions Used in This Book
- Learning Symfony
- Jumping between Chapters
- Regenerating Bootstrap Cache
- Composer Memory Errors
- Reinstalling Symfony
- Installing the Demo (Optional)
- References
-
Chapter 1: Survival Skills
- The Tools You Need
- Using the Command Line
- Selling Your Soul to the Demon
- Summary
- References
-
Chapter 2: What is SongBird
- So What is the Plan?
- Use Case Diagram
- Database Diagram
- User Journey
- Sitemap
- User Stories
- User Scenarios
- Summary
- References
-
Chapter 3: Creating the Dev Environment
- Installation
- Mac Users (Optional)
- Summary
- Exercises (Optional)
- References
-
Chapter 4: The Testing Framework Part 1 (Optional)
- Installation
- The First Test
- Summary
- Exercises (Optional)
- Resources
-
Chapter 5: The Testing Framework Part 2 (Optional)
- Modifying DefaultController.php
- Making sure the / route is removed
- Creating custom bash script to run acceptance test
- Summary
- References
-
Chapter 6: The User Management System Part 1
- Pre-setup
- Installing the FOSUserBundle
- DB credentials
- Creating the User Entity
- Wrapper Scripts
- Summary
- Exercises (Optional)
- References
-
Chapter 7: The User Management System Part 2
- Automated User CRUD Generation
- Adding Fields to the User Form
- What’s Up With Editing the User
- Updating Doctrine Fields Automatically
- Deleting Users
- Cleaning Up
- Summary
- Exercises (Optional)
- References
-
Chapter 8: Doctrine Fixtures and Migrations
- Install DoctrineFixturesBundle
- Create User Fixtures
- Doctrine Migrations
- Create Script to Reset Schema and Fixtures
- Update runtest script
- Summary
- References
-
Chapter 9: The Admin Panel Part 1
- Install EasyAdminBundle
- Services
- Filtering the User fields
- Redirecting Users to Dashboard After Login
- User Roles and Security
- Cleaning up
- Summary
- Exercises
- References
-
Chapter 10: BDD With Codeception (Optional)
- User Stories
- User Scenarios
- Creating the Cest Class
- Summary
- Exercises
- References
-
Chapter 11: Customising the Login Process
- Defining User Stories and Scenarios
- Customise the Login Page
- Installing Mailcatcher
- Customise the Request Password Page
- Customise the Reset Password Process
- Summary
- Exercises
- References
-
Chapter 12: The Admin Panel Part 2
- Tweaking the UI
- Your Dashboard
- Menu Tweaking
- Removing hardcoding of admin prefix
- Update BDD Test (Optional)
- Summary
- Exercises
- References
-
Chapter 13: Internalisation
- Define User Story
- Translations for the AppBundle
- Update the Dashboard
- Sticky Locale
- Update BDD (Optional)
- Summary
- Exercises
- References
-
Chapter 14: Uploading Files
- Update User Stories
- Install Vich Uploader Bundle
- Update Fixtures
- Update UI
- Update BDD (Optional)
- Summary
- Exercises
- References
-
Chapter 15: Logging User Activities
- Define User Stories
- Implementation
- Update BDD (Optional)
- Summary
- Exercises
- References
-
Chapter 16: Improving Performance and Troubleshooting
- Install Blackfire
- Upgrade ResetApp Script
- Optimising Composer
- Minimising JS/CSS
- Troubleshooting
- Identifying bottlenecks with blackfire.io
- Reverse Proxy and APCU
- Fix Coding Standards with PHP-CS-Fixer
- Summary
- Exercises
- References
-
Chapter 17: The Page Manager Part 1
- The Plan
- Define User Stories
- Create Our Own Bundle Generation Script (Optional)
- Implementation
- Create Sample Data
- Integrating NestableJS
- Create Functional Tests (Optional)
- Summary
- Exercises
- References
-
Chapter 18: Making Your Bundle Reusable
- Creating a separate repository
- Updating Application composer.json
- Renaming SongbirdNestablePageBundle
- Making the Bundle Extensible
- Extending BpehNestablePageBundle
- Summary
- Exercises
- References
-
Chapter 19: The Page Manager Part 2
- Define User Stories
- Adding new image field to PageMeta Entity
- Installing CKEditor
- Integration with EasyAdminBundle
- Creating Custom Locale Selector Form Type
- Update BDD Tests (Optional)
- Summary
- Exercises
- References
-
Chapter 20: The Front View
- Define User Stories
- Creating the Frontend
- Update BDD (Optional)
- Summary
- Exercises
- References
-
Chapter 21: Dependency Injection Revisited
- Simplifying config.yml
- Adding Simple Access Control to EasyAdminBundle
- Adding Roles to EasyAdmin Actions
- Cleaning up
- Update BDD (Optional)
- Summary
- Exercises
- References
- Final Chapter: Conclusion
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $13 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them