PHP code example of aboutcoders / enum-serializer-bundle
1. Go to this page and download the library: Download aboutcoders/enum-serializer-bundle library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
aboutcoders / enum-serializer-bundle example snippets
php composer.phar
php
# app/AppKernel.php
public function registerBundles()
{
$bundles = array(
...
new Abc\Bundle\EnumSerializerBundle\AbcEnumSerializerBundle(),
);
}
php
$serializer = $container->get('jms_serializer');
$data = $serializer->serialize($subject, 'json');
$enum = $this->serializer->deserialize($data, MyExample::class, 'json');