Skip to content

Kévin Dunglas

Founder of Les-Tilleuls.coop (worker-owned cooperative). Creator of API Platform, 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 Reply Cancel reply

Follow me on Twitter

My Tweets

Subscribe to this blog

Recent Posts

  • New in Caddy 2.5: Redact Sensitive Data from Your Logs
  • Building Decentralized Web Apps with Solid and PHP
  • JSON Columns and Doctrine DBAL 3 Upgrade
  • Preventing CORS Preflight Requests Using Content Negotiation
  • Symfony’s New Native Docker Support (Symfony World)

Top Posts & Pages

  • JSON Columns and Doctrine DBAL 3 Upgrade
  • Generate a Symfony password hash from the command line
  • Using the "103 Early Hints" Status Code in Go Applications
  • Symfony and API Platform get "push" and real-time capabilities (Mercure protocol)
  • API Platform 2.6: PHP 8 support, Next.js and Nuxt.js app generator, Caddy server, ActivityPub and much more!
  • Symfony's New Native Docker Support (Symfony World)
  • Preventing CORS Preflight Requests Using Content Negotiation
  • Using Next.js and Material UI Together
  • Building Decentralized Web Apps with Solid and PHP
  • Introducing the SocialShare PHP library

Persistence in PHP with the Doctrine ORM

Persistence in PHP with the Doctrine ORM

Tags

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

Archives

Categories

  • DevOps (24)
  • Mercure (3)
  • Opinions (91)
  • Programming (178)
    • Android (5)
    • Go (11)
    • JavaScript (43)
    • PHP (136)
      • API Platform (60)
      • Symfony (89)
    • Python (14)
      • Django (5)
  • Security (15)
  • SEO (24)
  • Talks (37)
  • Ubuntu (68)
  • Wordpress (6)

Blogoliste

  • API Platform
  • Les-Tilleuls.coop
  • Mercure.rocks
  • Vulcain.rocks
© 2022 Kévin Dunglas | Powered by Minimalist Blog WordPress Theme