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.
Informations about the package craft3-beam
Beam for Craft CMS
Generate CSV and Excel (XLSX) files directly from your Craft CMS templates
Table of contents
- Requirements
- Installation
- Quick start
- Usage guide
- Basic usage
- Output formats
- Dynamic content
- Configuration methods
- Advanced features
- Custom cell formatting
- Supported format types
- Multiple sheets
- Soft newlines
- Common use cases
- Load-balanced environments
- About
Requirements
- Craft CMS 5.0.0 or later
- PHP 8.2 or later
Legacy version support
For older Craft CMS versions: - **Craft 4**: Use Beam 3.x - **Craft 3**: Use Beam 2.xInstallation
Install via Composer from your Craft project directory:
Note: The package name is
superbig/craft3-beamfor 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:
- Go to Settings → Plugins
- 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:
- Utilities → Caches → Beam temp files
php craft clear-caches/beam-temp(also included inphp craft clear-caches/all)
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:
- Utilities → Caches → Beam temp files
php craft clear-caches/beam-temp(also included inphp craft clear-caches/all)
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
craftcms/cms Version ^5.0.0
league/csv Version ^9.0
mk-j/php_xlsxwriter Version ^0.39.0