Skip to content

Kévin Dunglas

Founder of Les-Tilleuls.coop (worker-owned cooperative). Creator of API Platform, FrankenPHP, Mercure.rocks, Vulcain.rocks and of some Symfony components.

Menu
  • Talks
  • Resume
  • Sponsor me
  • Contact
Menu

Mastering the Symfony Serializer (PHP Tour)

Posted on May 17, 2018September 26, 2021 by Kévin Dunglas

The Symfony Serializer Component exists since the very beginning of Symfony 2. Years after years, it gained a lot of new features useful to transform various data formats to PHP structures and the opposite. It is also a foundation block of API Platform and a first-class citizen in FOSRest.

Let’s dive into this component. We will cover the basic concepts behind the serialization process: normalization, denormalization, encoding and decoding.

Then we will discover all the little known features of the component: JSON, XML and CSV support, file handling with “data:” URIs, serialization groups, attributes names conversion, trees support, updating existing objects, dealing with circular references.

Finally we will learn how to create custom normalizers and encoders; and how to modify the behavior of the builtin ones using composition.

Related posts:

  1. Symfony 4 Run-through (Forum PHP 2017)
  2. HTTP/2, PHP and Symfony: a brief history of the protocol powering the web, and how to use it
  3. API Platform and Symfony: a Framework for API-driven Projects (SymfonyCon)
  4. Making the Symfony PropertyAccess Component 84% faster in 2.8… and counting

Leave a ReplyCancel reply

Social

  • Bluesky
  • GitHub
  • LinkedIn
  • Mastodon
  • X
  • YouTube

Links

  • API Platform
  • FrankenPHP
  • Les-Tilleuls.coop
  • Mercure.rocks
  • Vulcain.rocks

Subscribe to this blog

Top Posts & Pages

  • FrankenPHP: The Modern Php App Server, written in Go
  • JSON Columns and Doctrine DBAL 3 Upgrade
  • Securely Access Private Git Repositories and Composer Packages in Docker Builds
  • Unleash the Monster: The FrankenPHP elePHPant is Born
  • Preventing CORS Preflight Requests Using Content Negotiation
  • Webperf: Boost Your PHP Apps With 103 Early Hints
  • PHP and Symfony Apps As Standalone Binaries
  • PHP 7: Introducing a domain name validator and making the URL validator stricter
  • The Best of Both Worlds: Go-Powered gRPC for Your PHP and API Platform Apps
  • Un lecteur de flux RSS pour Android : la base de données intégrée

Tags

Apache API API Platform Buzz Caddy Docker Doctrine FrankenPHP Go Google GraphQL HTTP/2 Hydra hypermedia Hébergement Javascript JSON-LD Kubernetes La Coopérative des Tilleuls Les-Tilleuls.coop Lille Linux Mac Mercure Mercure.rocks Messagerie Instantanée MySQL performance PHP Punk Rock Python React REST Rock'n'Roll Schema.org Security SEO SEO Symfony Symfony Live Sécurité Ubuntu Web 2.0 webperf XML

Archives

Categories

  • DevOps (85)
    • Ubuntu (68)
  • Go (20)
  • JavaScript (46)
  • Mercure (7)
  • Opinions (91)
  • PHP (175)
    • API Platform (79)
    • FrankenPHP (14)
    • Laravel (1)
    • Symfony (97)
    • Wordpress (6)
  • Python (14)
  • Security (15)
  • SEO (25)
  • Talks (46)
© 2025 Kévin Dunglas | Powered by Minimalist Blog WordPress Theme