concrete/src/Page/Controller/DashboardExpressEntriesPageController.php
public function csv_export($treeNodeParentID = null)
    {
        $me = $this;
        $parent = $me->getParentNode($treeNodeParentID);
        $entity = $me->getEntity($parent);
        $permissions = new \Permissions($entity);
        if (!$permissions->canViewExpressEntries()) {
            throw new \Exception(t('Access Denied'));
        }

        $headers = [
            'Content-Type' => 'text/csv',
            'Content-Disposition' => 'attachment; filename=' . $entity->getHandle() . '.csv',
        ];
        $config = $this->app->make('config');
        $bom = $config->get('concrete.export.csv.include_bom') ? $config->get('concrete.charset_bom') : '';

        return StreamedResponse::create(function () use ($entity, $me, $bom) {
            $entryList = new EntryList($entity);

            $writer = new CsvWriter($this->app->make(WriterFactory::class)->createFromPath('php://output', 'w'), new Date());
            echo $bom;
            $writer->insertHeaders($entity);
            $writer->insertEntryList($entryList);
        }, 200, $headers);
    }
public function csv_export($treeNodeParentID = null)
    {
        $me = $this;
        $parent = $me->getParentNode($treeNodeParentID);
        $entity = $me->getEntity($parent);
        $permissions = new \Permissions($entity);
        if (!$permissions->canViewExpressEntries()) {
            throw new \Exception(t('Access Denied'));
        }

        $headers = [
            'Content-Type' => 'text/csv',
            'Content-Disposition' => 'attachment; filename=' . $entity->getHandle() . '.csv',
        ];
        $config = $this->app->make('config');
        $bom = $config->get('concrete.export.csv.include_bom') ? $config->get('concrete.charset_bom') : '';

        return StreamedResponse::create(function () use ($entity, $me, $bom) {
            $entryList = new EntryList($entity);

            $writer = new CsvWriter($this->app->make(WriterFactory::class)->createFromPath('php://output', 'w'), new Date());
            echo $bom;
            $writer->insertHeaders($entity);
            $writer->insertEntryList($entryList);
        }, 200, $headers);
    }
public function csv_export ( $ treeNodeParentID = null ) { $ me = $ this ; $ parent = $ me -> getParentNode ( $ treeNodeParentID ) ; $ entity = $ me -> getEntity ( $ parent ) ; $ permissions = new \ Permissions ( $ entity ) ; if ( ! $ permissions -> canViewExpressEntries ( ) ) { throw new \ Exception ( t ( 'Access Denied' ) ) ; } $ headers = [ 'Content-Type' => 'text/csv' , 'Content-Disposition' => 'attachment; filename=' . $ entity -> getHandle ( ) . '.csv' , ] ; $ config = $ this -> app -> make ( 'config' ) ; $ bom = $ config -> get ( 'concrete.export.csv.include_bom' ) ? $ config -> get ( 'concrete.charset_bom' ) : '' ; return StreamedResponse :: create ( function ( ) use ( $ entity , $ me , $ bom ) { $ entryList = new EntryList ( $ entity ) ; $ writer = new CsvWriter ( $ this -> app -> make ( WriterFactory :: class ) -> createFromPath ( 'php://output' , 'w' ) , new Date ( ) ) ; echo $ bom ; $ writer -> insertHeaders ( $ entity ) ; $ writer -> insertEntryList ( $ entryList ) ; } , 200 , $ headers ) ; }
Export Express entries into a CSV.

@param int|null $treeNodeParentID

@return \Symfony\Component\HttpFoundation\Response
Export Express entries into a CSV .