PHP code example of heimrichhannot / contao-exporter-bundle

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

    

heimrichhannot / contao-exporter-bundle example snippets


'global_operations' => [
    'export_csv' => \Contao\System::getContainer()->get('huh.exporter.action.backendexport')
        ->getGlobalOperation('export_csv',$GLOBALS['TL_LANG']['MSC']['export_csv'])
],

$GLOBALS['BE_MOD']['mygroup']['name'] = [
    'export_csv' => ['huh.exporter.action.backendexport', 'export'],
    'tables' => ['tl_name'],
];

/** @var Symfony\Component\DependencyInjection\ContainerInterface $container */
$container->get('huh.exporter.action.export')->export($config: ExporterModel, $entity: int|string, $fields = []: array);

 
$fields = [
    'field1' => [
        'raw' => '', // raw field value
        'inputType' => '', // field input type 
        'value' => '', // formatted field value
        'formatted' => '', // formatted field value
        'label' => '', // formatted field value
    ],
    // ...
];


services:
  _defaults:
    autowire: true

  _instanceof:
    HeimrichHannot\ContaoExporterBundle\Exporter\ExporterInterface:
      tags: ['huh_exporter.exporter']
      lazy: true
      
  Your\Exporter\Class: ~