Download the PHP package vlad-x/pages-bundle without Composer
On this page you can find all versions of the php package vlad-x/pages-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vlad-x/pages-bundle
More information about vlad-x/pages-bundle
Files in vlad-x/pages-bundle
Package pages-bundle
Short Description Pages bundle for symfony and easy admin
License MIT
Informations about the package pages-bundle
vlad-x/pages-bundle
Symfony bundle providing reusable Page and Meta (SEO / OpenGraph) entities, a Vich Uploader image field, and EasyAdmin 5 field/CRUD helpers.
Features
Pagemapped superclass — title, slug, parent/child hierarchy with automaticfullSlugcomputation, and an embeddedMeta.Metaembeddable —metaTitle,metaDescription,metaKeywords,ogTitle,ogDescription,ogImage, and arbitrarymetaProperties({property, content}pairs).- Vich Uploader integration — OpenGraph image upload with validation (max 5M, JPEG/PNG) and
SmartUniqueNamer. - EasyAdmin 5 helpers — reusable
PageCrudController,MetaFields(SEO tab), andVichImageField. - Template assignment — pages can be rendered through configurable templates with optional custom form types for template data.
Installation
Enable the bundle in config/bundles.php:
Configuration
Usage
1. Create your page entity
Extend the Page mapped superclass:
2. Override mapped superclass fields
Since Page is a mapped superclass, you can override the mapping of its fields
in your own entity with Doctrine's AttributeOverrides. This lets you adjust
column definitions (length, nullability, uniqueness, ...) without touching the
bundle.
For example, make the inherited slug field longer and non-unique:
For more info, check out the official Doctrine documentation
2.1 Self Nesting
VladX\PagesBundle\Entity\Page mapped supperclass contains unmapped parent/children fields. To enable entity self nesting use VladX\PagesBundle\Attributes\Nestable Attribute. For example:
Create migration and apply it:
3. Create the EasyAdmin CRUD controller
Extend the abstract PageCrudController — it wires the general fields, the template tab, and the SEO tab:
You can add custom fields via addGeneralFields():
4. Render the page
In your template, use PageHelper to build the meta data and the configured template:
Render the SEO meta tags in your base layout:
Twig templates
@Pages/meta_fields.html.twig— renders<meta>tags from ametaobject withtitle,descriptionandproperties.@Pages/admin/vich_image.html.twig— EasyAdmin field template for Vich images.
License
MIT — see LICENSE.
All versions of pages-bundle with dependencies
easycorp/easyadmin-bundle Version ^5.0
presta/sitemap-bundle Version ^4.3
symfonycasts/dynamic-forms Version ^0.2.0
vich/uploader-bundle Version ^2.9