Projet SunshineAdminBundle

Entity Basic Mapping

This page intends to describe the basic configuration options existing for an entity. It should be considered as a quickstart module.
Advanced mapping options are described in another page.

Yaml Configuration

The configuration fil describes sections for :

  • The Entity as global definition.
  • The Form View.
  • The List view.
    • The filters available in the list view.
    • The search section in the field view.

Configuration Section

This is the global declaration of the entity for the Sunshine Bundle.

Item Description
id identifier of the entity
class Class path
ROLES list of Roles wich may have full access to the entity

Attributes Section

This section describes each attributes with its defaults values. This makes easy to write only once most of configuration attributes. Elements in this section could be overwritten by any part of configuration (List, Form, Filters, Search…).

Item Description Contexts
label Default label used for the different views Global, List, Forms, Filters
type Type of data (String / integer / Object / Email / HTML )… Global, List, Forms, Filters
sortable true / false : enable the sorting Global, List, Forms, Filters
relatedClass  Name and path to the class linked by a relation. Global, List, Forms, Filters
filterAttribute Attribute of foreign class to use for search and filtering. Global, List, Forms, Filters
callbackFunction Method in the entity repository to call for lists. see doc. Global, List, Forms, Filters
order desc or asc, define the sorting way. List

Form Section

This section describes each attributes for the form view.

Item Description
label Default label used for the different views
type Type of data (String / integer / Object / Email / HTML )…
placeholder Define a placeholder for the field.
readOnly Define if a field must be in a read only status
<fieldName>  This is the name of a property from the attribute section.
formType  FormType to use instead of Sunshine generic formType.
jsIncludes Custom Js to include in rendering
cssIncludes Custom Css to include in rendering.

List Section

This section describes each attributes for the list views.

Item Description
label Default label used for the different views
<fieldName> This is the name of a property from the attribute section.
<fieldName>/label Label text to override default attribute
<fieldName>/type Type text to override detection or default attribute. Makes also possible to create « custom » columns like for action buttons or elements not related to entity
<fieldName>/template Template to use for column rendering. see documentation for lists.
<fieldName>/order  Set the sort order of the column.

Filters Section

This section describes each attributes for the filters. A filter is a restrictive measure on a field. It appears on the list view.

Item Description
label Default label used for the different views

Search Section

This section describes each attributes for the search. The search will consider the fields with a ‘OR’ request.

Item Description
label Default label used for the different views

 

About the author

Eric Wallet

Add Comment

Click here to post a comment

Votre adresse de messagerie ne sera pas publiée.