Download the PHP package superbig/craft3-beam without Composer

On this page you can find all versions of the php package superbig/craft3-beam. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package craft3-beam

Beam for Craft CMS

Latest Version

Generate CSV and Excel (XLSX) files directly from your Craft CMS templates

Table of contents

Requirements

Legacy version support For older Craft CMS versions: - **Craft 4**: Use Beam 3.x - **Craft 3**: Use Beam 2.x

Installation

Install via Composer from your Craft project directory:

Note: The package name is superbig/craft3-beam for all Craft CMS versions (3, 4, and 5). The version automatically installed matches your Craft version.

Then install the plugin in the Craft Control Panel:

  1. Go to Settings → Plugins
  2. Find Beam and click Install

Quick start

Generate a CSV file with just a few lines:

That's it! The file will automatically download in the user's browser.

Usage guide

Basic usage

Every Beam export starts by creating a Beam instance with craft.beam.create():

Output formats

Generate CSV

Generate Excel (XLSX)

Dynamic content

Build your export dynamically using loops and the append() method:

Configuration methods

Beam provides several methods to customize your export:

Set Custom Filename
Update Headers
Replace Content

Advanced features

Custom cell formatting

Excel (XLSX) files support custom cell formatting. Define column types in the header:

Supported format types

Type Excel Format Example Output
string @ Text
integer 0 12345
date YYYY-MM-DD 2024-01-15
datetime YYYY-MM-DD HH:MM:SS 2024-01-15 14:30:00
time HH:MM:SS 14:30:00
price #,##0.00 1,234.56
dollar [$$-1009]#,##0.00;[RED]-[$$-1009]#,##0.00 $1,234.56
euro #,##0.00 [$€-407];[RED]-#,##0.00 [$€-407] €1.234,56

Multiple sheets (XLSX only)

You can create an Excel file with multiple sheets using the fluent sheet() method:

You can switch between sheets as needed:

More sheet configuration options The `sheet()` method also accepts an options array as the second parameter: #### Alternative: Using array-based configuration If you need to configure all sheets upfront, you can provide a `sheets` array in the options: Or build the sheets array dynamically with `setSheets()`: **Note:** The `sheets` configuration only works with XLSX exports. If you use it with `csv()`, it will be ignored and a standard single-sheet CSV will be generated.

Soft newlines in XLSX cells

Soft newlines (line breaks within cells) are supported in XLSX files. Simply use \n in your cell content:

You can also join arrays with newlines to create multi-line cells:

Text wrapping is enabled by default to properly display multi-line content. If you need to disable it:

Common use cases

Export Entry Data
Export Commerce Orders > **Note:** This example requires [Craft Commerce](https://craftcms.com/commerce) to be installed.
Export with Formatted Numbers

Load-balanced environments

Beam writes export files to Craft's temp asset upload filesystem under a beam/ prefix. On Craft Cloud and any multi-instance or load-balanced host, configure a shared filesystem so the download request can see the file created by the generate request:

Or set the CRAFT_TEMP_ASSET_UPLOAD_FS environment variable.

Temp files are not deleted automatically. Clear them with:

Optionally, enable Delete files after download under Settings → Plugins → Beam (environment variables are supported).

About

Multiple sheets in Excel (XLSX only):

You can create an Excel file with multiple sheets using the fluent sheet() method:

You can switch between sheets as needed:

The sheet() method also accepts an options array as the second parameter:

Alternative: Using array-based configuration

If you need to configure all sheets upfront, you can provide a sheets array in the options:

Or build the sheets array dynamically with setSheets():

Note: The sheets configuration only works with XLSX exports. If you use it with csv(), it will be ignored and a standard single-sheet CSV will be generated.

Soft newlines in XLSX cells:

Soft newlines (line breaks within cells) are supported in XLSX files. Simply use \n in your cell content:

You can also join arrays with newlines to create multi-line cells:

Text wrapping is enabled by default to properly display multi-line content. If you need to disable it:

Load-balanced environments

Beam writes export files to Craft's temp asset upload filesystem under a beam/ prefix. On Craft Cloud and any multi-instance or load-balanced host, configure a shared filesystem so the download request can see the file created by the generate request:

Or set the CRAFT_TEMP_ASSET_UPLOAD_FS environment variable.

Temp files are not deleted automatically. Clear them with:

Optionally, enable Delete files after download under Settings → Plugins → Beam (environment variables are supported).

Brought to you by Superbig

Useful Resources:


All versions of craft3-beam with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
craftcms/cms Version ^5.0.0
league/csv Version ^9.0
mk-j/php_xlsxwriter Version ^0.39.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package superbig/craft3-beam contains the following files

Loading the files please wait ...