Skip to content

Render Refactoring#8

Open
marcus-n3rd wants to merge 2 commits into
wellebee:8.x-2.xfrom
marcus-n3rd:render
Open

Render Refactoring#8
marcus-n3rd wants to merge 2 commits into
wellebee:8.x-2.xfrom
marcus-n3rd:render

Conversation

@marcus-n3rd

Copy link
Copy Markdown

Turns out that I was wrong with PR #4, as it never actually processed the render class. After stepping through the module's current render process and comparing it to others (image field's namely). I decided it could be simplified and still operate as it has been.

I feel this will innately solve the same problems that PRs #2, #3, and #5 are trying to solve.

I doubt this is the final answer, but I think this should be a good start.

Removed the module file and moved the view argument parsing to the ViewfieldDefaultFormatter class.

Adding a theme element seemed excessive for a couple of HTML element classes, so `viewfield_formatter_default` and its twig file was removed.

Recursion prevention could be handled in the ViewfieldDefaultFormatter::prepareView() method. (WIP, likely next commit).
Also, renamed machine name from `viewfield_default` to `viewfield_formatter`. Note that I personally debated having it simply `viewfield` to match the naming conventions of core, the image field in particular.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant