-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
965 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
DataGridBundle | ||
============== | ||
General: | ||
[![Build Status](https://travis-ci.com/pfilsx/DataGridBundle.svg?branch=master)](https://travis-ci.com/pfilsx/DataGridBundle) | ||
|
||
Quality: | ||
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/pfilsx/DataGridBundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/pfilsx/DataGridBundle/?branch=master) | ||
[![Build Status](https://scrutinizer-ci.com/g/pfilsx/DataGridBundle/badges/build.png?b=master)](https://scrutinizer-ci.com/g/pfilsx/DataGridBundle/build-status/master) | ||
[![Code Intelligence Status](https://scrutinizer-ci.com/g/pfilsx/DataGridBundle/badges/code-intelligence.svg?b=master)](https://scrutinizer-ci.com/code-intelligence) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
ActionColumn Class Reference | ||
============================ | ||
|
||
Usage | ||
----- | ||
|
||
.. code-block:: php | ||
$builder->addColumn(self::ACTION_COLUMN, [ | ||
'pathPrefix' => 'path_prefix' | ||
]); | ||
Configuration | ||
------------- | ||
|
||
attributes - array(default: []) | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
html attributes to be applied to the tag <td>. | ||
|
||
buttonsTemplate - string(default: '{show} {edit} {delete}') | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
buttons rendering template. | ||
|
||
buttons - array(default: []) | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Can be used to override default button rendering. | ||
|
||
.. code-block:: php | ||
$builder->addColumn(self::ACTION_COLUMN, [ | ||
'buttons' => [ | ||
'show' => function(Object $entity, string $url){ | ||
return '<a href="'.$url.'?id='.$entity->id.'">Show</a>'; | ||
} | ||
] | ||
]); | ||
buttonsVisibility - array(default: ['show' => true, 'edit' => true, 'delete' => true]) | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Can be used to set visibility of each button. | ||
|
||
format - string(default: 'raw') | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Format of the output data(raw|html). | ||
|
||
pathPrefix - string(default: null) | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Path prefix would be used in default url generation. | ||
|
||
visible - boolean(default: true) | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
whether to display a column. | ||
|
||
urlGenerator - callable(default: null) | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Can be used to override default url generation function. | ||
|
||
.. code-block:: php | ||
$builder->addColumn(self::ACTION_COLUMN, [ | ||
'buttons' => [ | ||
'urlGenerator' => function($entity, string $action, RouterInterface $router){ | ||
return $router->generate('entity-'.$action, ['guid' => $entity->getId()]); | ||
} | ||
] | ||
]); | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
ActionColumn Class Reference | ||
============================ | ||
|
||
Usage | ||
----- | ||
|
||
.. code-block:: php | ||
$builder->addColumn(self::BOOLEAN_COLUMN, [ | ||
'attribute' => 'entity_attribute', | ||
'trueValue' => 'yes', | ||
'falseValue' => 'no' | ||
]); | ||
Configuration | ||
------------- | ||
|
||
attribute - string(default: null) | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Entity attribute. | ||
|
||
attributes - array(default: []) | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
html attributes to be applied to the tag <td>. | ||
|
||
filter - array(default: []) | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Filter configuration. See filters docs. | ||
|
||
.. code-block:: php | ||
$builder->addColumn(self::BOOLEAN_COLUMN, [ | ||
... | ||
'filter' => [ | ||
'class' => self::FILTER_BOOLEAN | ||
] | ||
]); | ||
format - string(default: 'raw') | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Format of the output data(raw|html). | ||
|
||
label - string(default: attribute name|'') | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Label of column. | ||
|
||
trueValue - string(default: 'yes') | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Text output for true value. | ||
|
||
falseValue - string(default: 'no') | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Text output for false value. | ||
|
||
value - callable(default: null) | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Can be used to override default output generation. | ||
|
||
.. code-block:: php | ||
$builder->addColumn(self::BOOLEAN_COLUMN, [ | ||
... | ||
'value' => function($entity) { | ||
return $entity->isEnabled ? 'enabled' : 'disabled'; | ||
} | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
DataColumn Class Reference | ||
============================ | ||
|
||
Usage | ||
----- | ||
|
||
.. code-block:: php | ||
$builder->addColumn(self::DATA_COLUMN, [ | ||
'attribute' => 'entity_attribute' | ||
]); | ||
Configuration | ||
------------- | ||
|
||
attribute - string(default: null) | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Entity attribute. | ||
|
||
attributes - array(default: []) | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
html attributes to be applied to the tag <td>. | ||
|
||
filter - array(default: []) | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Filter configuration. See filters docs. | ||
|
||
.. code-block:: php | ||
$builder->addColumn(self::DATA_COLUMN, [ | ||
... | ||
'filter' => [ | ||
'class' => self::FILTER_TEXT | ||
] | ||
]); | ||
format - string(default: 'raw') | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Format of the output data(raw|html). | ||
|
||
label - string(default: attribute name|'') | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Label of column. | ||
|
||
value - callable(default: null) | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Can be used to override default output generation. | ||
|
||
.. code-block:: php | ||
$builder->addColumn(self::DATA_COLUMN, [ | ||
'value' => function($entity) { | ||
return $entity->isEnabled ? 'enabled' : 'disabled'; | ||
} | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
DateColumn Class Reference | ||
============================ | ||
|
||
Usage | ||
----- | ||
|
||
.. code-block:: php | ||
$builder->addColumn(self::DATE_COLUMN, [ | ||
'attribute' => 'entity_attribute' | ||
]); | ||
Configuration | ||
------------- | ||
|
||
attribute - string(default: null) | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Entity attribute. | ||
|
||
attributes - array(default: []) | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
html attributes to be applied to the tag <td>. | ||
|
||
dateFormat - string(default: 'd.m.Y') | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Date format for output. See `PHP_Date`_ | ||
|
||
filter - array(default: []) | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Filter configuration. See filters docs. | ||
|
||
.. code-block:: php | ||
$builder->addColumn(self::DATE_COLUMN, [ | ||
... | ||
'filter' => [ | ||
'class' => self::FILTER_TEXT | ||
] | ||
]); | ||
format - string(default: 'raw') | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Format of the output data(raw|html). | ||
|
||
label - string(default: attribute name|'') | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Label of column. | ||
|
||
value - callable(default: null) | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Can be used to override default output generation. | ||
|
||
.. code-block:: php | ||
$builder->addColumn(self::DATE_COLUMN, [ | ||
'value' => function($entity) { | ||
return $entity->getCreationDate()->format('d.m.Y'); | ||
} | ||
]); | ||
.. _`PHP_Date`: http://php.net/manual/ru/function.date.php |
Oops, something went wrong.