PHP code example of psamatt / yaml-export-bundle

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

    

psamatt / yaml-export-bundle example snippets




// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Psamatt\YamlExportBundle\PsamattYamlExportBundle(),
    );
}


// ..
	public function getDataSet()
	{
		$dataSet = new \PHPUnit_Extensions_Database_DataSet_YamlDataSet(dirname(__FILE__) . "/_files/BlogPost/seed.yml");
		// .. Add further YAML files
		// $dataSet->addYamlFile(dirname(__FILE__) . "/_files/path/to/other/seed.yml");		
		return $dataSet;
	}
// ..