Practical Symfony
Practical Symfony
Free!
Minimum price
$20.00
Suggested price
Practical Symfony

This book is 100% complete

Completed on 2017-03-10

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.

About the Author

Bernard Peh
Bernard Peh

I am a thinker, innovator, web developer and open source enthusiast. As a motivated software developer for more than 10 years, I am always looking to implement new and innovative ideas. I love experimenting, talking to people and keeping busy. During my free time, I blog, spend time with my family and think about the universe.

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

Authors have earned$8,253,093writing, publishing and selling on Leanpub,
earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.

Learn more about writing on Leanpub

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

Free Updates. Free App. 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), EPUB (for phones and tablets), MOBI (for Kindle) and in the free Leanpub App (for Mac, Windows, iOS and Android). 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

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Learn more about writing on Leanpub