Download the PHP package pointybeard/symphony-section-builder without Composer
On this page you can find all versions of the php package pointybeard/symphony-section-builder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pointybeard/symphony-section-builder
More information about pointybeard/symphony-section-builder
Files in pointybeard/symphony-section-builder
Package symphony-section-builder
Short Description A set of classes and scripts for automating the creation and updating of sections and their fields.
License MIT
Homepage https://github.com/pointybeard/symphony-section-builder
Informations about the package symphony-section-builder
Symphony CMS: Section Builder
- Version: 0.2.1
- Date: Aug 6 2019
- Release notes
- GitHub repository
A set of classes that assist with the creating and updating of sections and their fields.
Installation
This libary can be used standalone or as part of a Symphony CMS installation (including Extension).
Standalone
Clone desired version from the GitHub repository with git clone https://github.com/pointybeard/symphony-section-builder.git
then run composer update
within that folder. Note, this will install dev library symphonycms/symphony-2
by default. Use --no-dev
when running composer update
to skip this.
Using Composer
To install via Composer, use composer require pointybeard/symphony-section-builder
or add "pointybeard/pointybeard/symphony-section-builder": "^0.2.0"
to your composer.json
file.
And run composer to update your dependencies, for example:
$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update
Note that this method will NOT install any dev libraries, specifically symphonycms/symphony-2
. Generally this is the desired behaviour, however, should the core Symphony CMS library not get included anywhere via composer (e.g. Section Builder is being used as part of a library that doesn't already include Symphony CMS), be use to use the --dev
flag (e.g. composer update --dev
) to ensure symphonycms/symphony-2
is also installed, or, use the --symphony=PATH
option to tell Section Builder where to load the Symphony CMS core from.
Usage
Quick example of how to use this library:
Importing JSON
Run bin/import
from the command line or use code like this:
Use flag FLAG_SKIP_ORDERING
if importing partial section JSON. This helps
to avoid a circular dependency exception being thrown. Flags are supported by fromJsonFile()
, fromJsonString()
, and fromObject()
. For example:
JSON must be an array of sections and look like this:
Exporting
Run bin/export
from the command line or use the __toString()
, __toJson()
, and/or __toArray()
methods provided by AbstractField
and Section
. For example:
If a full export is necessary, use the all()
method and build the array before encoding it to JSON. e.g.
Note that IDs (specifically Section and Field id
and Field sectionId
properties) are automatically stripped out by __toString()
and __toJson()
. To keep them, either use __toArray()
and encode to JSON yourself, or using __toJson()
but set $excludeIds
to false. e.g. $section->__toJson(false)
. See this implementation in the Trait hasToStringToJsonTrait
.
Diff
You can compare a database with a JSON export via bin/diff
from the command line or use code like this:
Support
If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.
Contributing
We encourage you to contribute to this project. Please check out the Contributing documentation for guidelines about how to get involved.
License
"Symphony CMS: Section Builder" is released under the MIT License.
All versions of symphony-section-builder with dependencies
pointybeard/symphony-pdo Version ~0.1.0
pointybeard/helpers Version ~1.2.0
pointybeard/property-bag Version ^1.0