PHP code example of porkchopsandwiches / preserialiserserviceprovider

1. Go to this page and download the library: Download porkchopsandwiches/preserialiserserviceprovider 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/ */

    

porkchopsandwiches / preserialiserserviceprovider example snippets


use PorkChopSandwiches\PreserialiserServiceProvider\PreserialiserServiceProvider;

$app -> register(new PreserialiserServiceProvider(), array(
	"preserialiser.default_args"    => array()
));

$result = $app["preserialiser"] -> preserialise(...);

class MyApplication extends \Silex\Application {
	use PorkChopSandwiches\PreserialiserServiceProvider\PreserialiserTrait;
}

$app = new MyApplication();

$app -> get("/", function () {

	# Access Preserialiser instance
	$app -> getPreserialiser() -> addDefaultArgs(array("foo" => true)) -> preserialise(...);

	# Invoke preserialise() directly
	$result = $app -> preserialise(...);
});