Download the PHP package chamber-orchestra/meta without Composer
On this page you can find all versions of the php package chamber-orchestra/meta. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download chamber-orchestra/meta
More information about chamber-orchestra/meta
Files in chamber-orchestra/meta
Package meta
Short Description Symfony 8 library providing a Doctrine ORM trait for SEO meta fields — title, description, keywords, Open Graph image, and robots behaviour
License MIT
Informations about the package meta
ChamberOrchestra Meta
Symfony 8 library providing a Doctrine ORM trait for SEO meta fields — title, description, keywords, Open Graph image, and robots behaviour. Mix into any Doctrine entity with zero boilerplate.
Features
MetaTrait— adds SEO fields to any Doctrine entity via a singleusestatementRobotsBehaviour— int-backed PHP enum withformat()for robots meta tag output (index, follow,noindex, nofollow, etc.)getMeta()— returns a clean associative array for rendering, with automatic HTML stripping on descriptions- Native Doctrine enum mapping —
RobotsBehaviourstored asSMALLINTwithenumType, hydrated directly as an enum case - File-bundle integration — transient
File $metaImageproperty with#[UploadableProperty]for automatic image upload handling viachamber-orchestra/file-bundle
Requirements
- PHP ^8.5
- Symfony ^8.0
- Doctrine ORM ^3.0
chamber-orchestra/view-bundle^8.0chamber-orchestra/file-bundle(in consuming application, for image upload support)
Installation
Usage
1. Add meta fields to your entity
The #[Uploadable] attribute is required for file-bundle to handle the metaImage upload automatically.
This adds the following columns and properties:
| Property | Type | Persisted | Description |
|---|---|---|---|
title |
string |
yes | Page title (H1) |
metaTitle |
string |
yes | <title> / og:title |
metaImage |
File |
no | Transient upload (file-bundle) |
metaImagePath |
string |
yes | Social share image path |
metaDescription |
text |
yes | Meta description |
metaKeywords |
string |
yes | Meta keywords |
robotsBehaviour |
smallint |
yes | Robots enum (default: 1) |
2. Render meta tags in Twig
Pass the getMeta() array and the entity to your base layout, then build the <head>:
The getMeta() method automatically strips HTML tags from the description.
3. Robots behaviour enum
Available cases:
| Case | Value | Output |
|---|---|---|
IndexFollow |
0 | index, follow |
IndexNoFollow |
1 | index, nofollow |
NoIndexFollow |
2 | noindex, follow |
NoIndexNoFollow |
3 | noindex, nofollow |
Testing
License
MIT
All versions of meta with dependencies
chamber-orchestra/view-bundle Version 8.1.*
doctrine/orm Version ^3.0
symfony/http-foundation Version 8.1.*