Download the PHP package spyrit/page-builder-bundle without Composer
On this page you can find all versions of the php package spyrit/page-builder-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download spyrit/page-builder-bundle
More information about spyrit/page-builder-bundle
Files in spyrit/page-builder-bundle
Package page-builder-bundle
Short Description A page builder for Symfony and Doctrine.
License MIT
Homepage https://github.com/spyrit/SpyritPageBuilderBundle.git
Informations about the package page-builder-bundle
SpyritPageBuilderBundle
About
A page builder to integrate in a Symfony/Doctrine/Twig project.
Notice: this bundle is highly experimental, there may be important changes without warning.
Basic principles
A page is a set of lines which contain zones (think about the Bootstrap grid with rows and divs that cover columns).
Each zone can contain one or several blocks. A block is an instantiation of a widget. Widgets are a set of configurable elements.
A few widgets (button, image, horizontal line, text) are provided but you will need to implement your own based on the purpose of your application (custom videos, articles, etc.).
Installation
Require the bundle with composer:
composer require spyrit/page-builder-bundle
Storage
Ideally, we would like this bundle to be storage-agnostic.
For now, it has only been used with Doctrine, so you are encouraged to set up database, and the following entities Block, Page, Zone.
You can name those entities as you like. You can create specific entities or reuse ones from your project. You can make them use BlockTrait
, PageTrait
and ZoneTrait
but you don't have to. But your entities must extend BlockInterface
, PageInterface
, ZoneInterface
.
You will have to implement the getConfiguration
, setConfiguration
and getWidget
methods in your class to match your storage.
If you add custom widgets, you will also need to implement setWidget
.
How to use
Add a widget
- Create a class that heritates from BaseWidget.
- Create Twig templates for your widget (one editor template and one front template if needed)
- Create your widget's form
Render (read only)
- To display a build page (e.g. on a public route), you will need to call the
renderPage
method from theRenderManager
service.
Where render.html.twig
can mimic @SpyritPageBuilder/render/base.html.twig
.
Render (editor)
- To render the page builder (e.g. on a private route, for admins), you will need to call the
renderPage
method from theRenderManager
service, with the second argument astrue
.
Where editor.html.twig
can mimic @SpyritPageBuilder/editor/editor.html.twig
.
Styling the editor
You are encouraged to write your own CSS, but you can also use the provided page-builder.scss
. To use it, add this to your webpack.config.js
:
.addStyleEntry('css/page-builder', './vendor/spyrit/page-builder-bundle/src/Resources/public/css/page-builder.scss')
And in your editor page:
All versions of page-builder-bundle with dependencies
symfony/form Version ^4.0|^5.0
doctrine/orm Version ^2.5
twig/twig Version ^2.7|^3.0