Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #394 Allow to define custom field types and options on-the-fl…
…y (javiereguiluz, ogizanagi) This PR was merged into the master branch. Discussion ---------- Allow to define custom field types and options on-the-fly This PR is based on the great work done by @ogizanagi in #379. All credit goes for him. I've just done some minor refactorings. TODO: * Solve the ` if ($this->debug) { throw $e; }` in the Twig template. * Add tests. Commits ------- a0edb9c Added more tests cd2b770 Removed an unneeded argument 4d0a34e Fixed a minor typo in one error message 77ccd42 Added more tests for the new feature e55fad2 Reworded the documentation of the new feature 55db338 Fixed a minor error and added one test 7ed6b74 Fixed minor typos c7e734a Updated the documentation for the new feature fe745cc Introduced the "template" field option to define a custom template to render the field 64f88cd Minor tweaks 3adf8d5 Removed an unneeded variableº 5b7f4a7 Fixed some errors 8a4be07 Renamed fieldMetadata template variable by field_options ced2cae Removed an unneeded variable after the last change 886daf0 Refactored the code that looks for the custom field types templates 149f806 Throw an error when the entity uses a custom on-the-fly type without defining its related template a9203fa Allow custom fields dataTypes on-the-fly and pass fieldMetadata to templates. 3b210a2 Allows field templates to be customized by field name
- Loading branch information
Showing
25 changed files
with
378 additions
and
47 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
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
Binary file added
BIN
+58.2 KB
Resources/doc/images/easyadmin-design-customization-custom-data-types.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{% if format %} | ||
{{ format|format(value) }} | ||
{% if field_options.format %} | ||
{{ field_options.format|format(value) }} | ||
{% else %} | ||
{{ value|number_format }} | ||
{% endif %} |
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 |
---|---|---|
@@ -1 +1 @@ | ||
{{ value|date(format) }} | ||
{{ value|date(field_options.format) }} |
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 |
---|---|---|
@@ -1 +1 @@ | ||
{{ value|date(format) }} | ||
{{ value|date(field_options.format) }} |
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 |
---|---|---|
@@ -1 +1 @@ | ||
{{ value|date(format) }} | ||
{{ value|date(field_options.format) }} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{% if format %} | ||
{{ format|format(value) }} | ||
{% if field_options.format %} | ||
{{ field_options.format|format(value) }} | ||
{% else %} | ||
{{ value|number_format(2) }} | ||
{% endif %} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{% if format %} | ||
{{ format|format(value) }} | ||
{% if field_options.format %} | ||
{{ field_options.format|format(value) }} | ||
{% else %} | ||
{{ value|number_format(2) }} | ||
{% endif %} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{% if format %} | ||
{{ format|format(value) }} | ||
{% if field_options.format %} | ||
{{ field_options.format|format(value) }} | ||
{% else %} | ||
{{ value|number_format }} | ||
{% endif %} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{% if format %} | ||
{{ format|format(value) }} | ||
{% if field_options.format %} | ||
{{ field_options.format|format(value) }} | ||
{% else %} | ||
{{ value|number_format }} | ||
{% endif %} |
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 |
---|---|---|
@@ -1 +1 @@ | ||
{{ value|date(format) }} | ||
{{ value|date(field_options.format) }} |
Oops, something went wrong.