Download the PHP package jacerider/neo_extra_field without Composer

On this page you can find all versions of the php package jacerider/neo_extra_field. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package neo_extra_field

Extra Field module

The Extra Field module provides two plugin types. One for extra fields in entity forms and one for extra fields in entity views.

Developer usage

This module allows developers to add custom form elements to fieldable entities by providing a plugin. Two plugin types are provided: NeoExtraFieldForm and NeoExtraFieldDisplay. NeoExtraFieldForm elements typically provide form alters and can be positioned in an entity form (mode) just like field widgets. NeoExtraFieldDisplay elements typically combine existing entity data and format it for display. They can be positioned in an entity view mode just like field widgets. Unlike normal entity fields, the extra fields do not 'own' data and do not store. But they use entity data of the entity they are applied to.

Examples

The Extra Field Example module (modules/neo_extra_field_example) contains ready to use plugins of both Display and Form plugins. You can copy an example over to your (custom) module and modify it to suit your needs.

Site builder usage

Once created, the extra fields can be used in form and view modes like other fields. Extra fields are created for specific entity/entity type combinations. That is why you find extra field plugins only in specific form or view modes, not in all.

In the Manage form display tab of the entity for which the plugin is created, enable and position an NeoExtraFieldForm element relative to other fields. In the Manage display tab of an entity you can enable and position an NeoExtraFieldDisplay element relative to other fields.

(Optionally) print the output of an NeoExtraFieldDisplay element in a twig template. As any other field, the extra field is rendered in the entity's view mode. The render array of the element is provided as neo_extrafield[plugin_name]. For example in a node template: {{ content.neo_extrafield[plugin_name] }}.

API

Extra fields uses hook_entity_neo_extra_field_info() to declare fields per entity type and bundle. Plugins can be configured (with annotation) per entity type and per bundle.

In NeoExtraFieldForm plugins, the form and form state provided as parameter to the NeoExtraFieldFormInterface::formElement. The method must return a renderable form array.

In NeoExtraFieldDisplay plugins, the object of the entity being viewed is provided as parameter to NeoExtraFieldDisplayInterface::view. The method must return a renderable array.

As usual with plugins, an alter hook is available. See neo_extra_field.api.php for documentation of hook_neo_extra_field_form_info_alter() and hook_neo_extra_field_display_info_alter().

Form Plugins

Plugins of type "NeoExtraFieldForm" are used to provide Extra field forms. Plugin examples can be found in the included neo_extra_field_example module.

Form plugins must be placed in: [module name]/src/Plugin/NeoExtraField/Form. After creating a plugin, clear the cache to make Drupal recognise it.

Form plugins must at least extend the NeoExtraFieldFormInterface.

NeoExtraFieldForm annotation should at least contain:

To define a plugin for all bundles of a given entity type, use the '*' wildcard:

To define a plugin for all entity types and all their bundles, use:

Other annotation options:

Display Plugins

Plugins of type "NeoExtraFieldDisplay" can be used to provide Extra field displays. Plugin examples can be found in the included neo_extra_field_example module.

Display plugins must be placed in: [module name]/src/Plugin/NeoExtraField/Display. After creating a plugin, clear the cache to make Drupal recognize it.

Display plugins must at least extend the NeoExtraFieldDisplayInterface.

NeoExtraFieldDisplay annotation should at least contain:

See Form Plugins for more annotation options.

Plugin base classes

Different bases classes are provided each containing different tools.

NeoExtraFieldFormBase (form plugin)

Provides form plugins with some helpers to get additional form rendering context data.

NeoExtraFieldDisplayBase (display plugin)

When using this base class, all output formatting has to take place in the plugin. No HTML wrappers are provided around the plugin output.

NeoExtraFieldDisplayFormattedBase (display plugin)

When using this base class, the field output will be wrapped with field html wrappers. The field template can be used to override the html output as usual.


All versions of neo_extra_field with dependencies

PHP Build Version
Package Version
Requires drupal/core Version ^10.3
jacerider/neo Version ^1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jacerider/neo_extra_field contains the following files

Loading the files please wait ....