# jetformbuilder/3.6.6/components/export/export-tools.php

JetFormBuilder — Dynamic Blocks Form Builder, version 3.6.6. 40 lines.

- Page: https://pluginprobe.com/plugins/jetformbuilder/3.6.6/code/components/export/export-tools.php
- Raw: https://pluginprobe.com/plugins/jetformbuilder/3.6.6/raw/components/export/export-tools.php
- Modified: 2023-11-20T11:46:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/jetformbuilder/3.6.6/code/components/export/export-tools.php#L10-L20`.

```php
<?php


namespace JFB_Components\Export;

// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
	die;
}

class Export_Tools {

	/**
	 * @return Interfaces\Base_Export_It
	 */
	public static function get_exporter_by_format(): Interfaces\Base_Export_It {
		// phpcs:ignore WordPress.Security.NonceVerification.Recommended
		$exporter = self::get_exporter( sanitize_key( $_GET['format'] ?? 'csv' ) );

		return $exporter ?: self::get_exporter( 'csv' );
	}

	/**
	 * @param string $format
	 *
	 * @return false|Interfaces\Base_Export_It
	 */
	public static function get_exporter( string $format ) {
		$formats = apply_filters(
			'jet-form-builder/export/formats',
			array(
				'csv' => new Csv\Service(),
			)
		);

		return array_key_exists( $format, $formats ) ? $formats[ $format ] : false;
	}

}

```
