LuisM Posted June 15, 2021 Share Posted June 15, 2021 A serializer module for ProcessWire Pages. This module will add a new method to all pages, called serializer(), which returns JSON. https://github.com/Luis85/FlowtiPageSerializer ## Dependecies symfony/serializer symfony/property-access ## Requirements ProcessWire 3.x Composer ## Installation cd site/modules git clone firstname.lastname@example.org:Luis85/FlowtiPageSerializer.git cd FlowtiPageSerializer composer install ## Usage $page->serialize() will return the serialized Page Object as a JSON string representation containing all accessable fields calling $page->serialize('field_name') returns the Page Object with just this field $page->serialize(['field1', 'field2']) will return the choosen fields This is my initial commit, just cobbled together a wrapper around the symfony/serializer component which i plan to use for data serialization and deserialization. The module can just serialize a given page and limit its output a field string or an array of strings. Supports only json output right now. Supports only 1 dimension of data, so no reference titles / .dot syntax. Can someone please enlighten me how to setup a proper composer setup for PW Module Development btw? 5 Link to comment Share on other sites More sharing options...
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!Register a new account
Already have an account? Sign in here.Sign In Now