Download the PHP package hypejunction/hypeprototyper without Composer
On this page you can find all versions of the php package hypejunction/hypeprototyper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hypejunction/hypeprototyper
More information about hypejunction/hypeprototyper
Files in hypejunction/hypeprototyper
Package hypeprototyper
Short Description Entity prototyping
License GPL-2.0
Homepage http://hypejunction.com
Informations about the package hypeprototyper
hypePrototyper
A set of developer and administrator tools for prototyping and handling entity forms. This plugin attempts to create an easy way to build forms, validate user input, and display entity profiles.
Developer Notes
Prototypes
Prototypes have 3 different facades:
- Form displays a set of inputs that are used to modify entity information
- Action validates and handles user input
- Profile outputs entity information
Prototypes consist of fields and are meant to be tied to registered Elgg actions. Prototype fields can be populated using plugin hook.
The idea here is that entities of the same type and subtype can be modified by multiple actions. For example, a user entity can be created and modified by and actions.
Each prototype is tied to an instance of , or . If the entity does not exist yet, the prototype creates a new instance (but only saves it when the form has been submitted and validated).
Form
Action
The above will validate the form and add all values to the entity based. If the form validation fails, the user will be forwarded back to the form (forms are made sticky) and failing validation rules will be explained.
Profile
Fields
Fields are defined as pairs, where the is a name of an attribute, metadata, annotation etc. and is a string that describes the input type (e.g. text, dropdown etc) or an array with the following properties:
-
- type of an input, used as elgg_view("input/$type") (default )
-
- a model used to store and retrieve values (default )
- an entity attribute, e.g. guid
- an entity metadata
- an entity annotation
- an entity relationship
- an entity icon
- entity categories (hypeCategories)
- a model used to store and retrieve values (default )
-
- PHP class used to instantiate a Field with a custom data type
-
- type of value if different from , e.g when a text input expects an integer The value type is automatically added to 'type' validation rules, thus setting 'value_type' => 'integer' is also equivalent to 'validation_rules' => ['type' => 'integer']
-
- view used to dipslay an input, if different from "input/$type"
-
- view used to dipslay an output, if different from "output/$type"
-
- whether or not a user input is requried (default )
-
- whether or not the field is only visible to admins (default )
-
- whether or not the field should be hidden on automatically generated profile (default )
-
- order of the field (default )
-
- whether or not to display an access input (default ) This allows users to specify an access level for the metadata, annotation or attachment created
-
- what label to display with the input field (default )
- set to ;
- do not display a label any other custom string
- what label to display with the input field (default )
-
- what help text to display with the input field (default )
- set to ;
- do not display help text any other custom string
- what help text to display with the input field (default )
-
- whether or not a user can clone the field and add multiple values (default )
-
- an array of rule => expecation pairs You can define custom validation rules and use to validate the values See hypePrototyperValidators for a full list of available validators
- and - array of options to pass to the input
-
- comma-separated list of flags that can be used for input/output filtering
- all other options will be passed to the input view, so you can add for example
The following options are available for data type:
-
- store as inverse relationship
-
- make it a bilateral relationship (two relationships will be added)
Custom Fields
To define a new field type, register it as so:
The above registers a new input type 'icon' with a handler class IconField that extends abstract Field. The third parameter contains default key - value pairs (which can later be overridden in a hook). 'ui_sections' parameter specifies which sections should be disabled in the admin interface provided by hypePrototyperUI.