You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @APY/collaborators ,
I want to propose some improvements to the DataGridExtension, this is why I added tests with #983 PR, I want to test the current behavior before working on it.
Note 1: It is also possible to name blocks using ...column... instead of ...column_id... and ...column_type.... However this naming convention is not advised as it is ambiguous. It is only supported for backward compatibility.
As said in "Note 1" the "grid_column_%id|type%_cell" notation is "not advised". This notation is less discriminative than "grid_column_id..." and "grid_column_type..." but it is tested first in getGridCell and getGridFilter:
My proposal is to trigger a deprecation when this block name is used, and then we can plan to remove it.
Second, the column's getParentType method is totally useless: it returns an empty string and is never used.
Moreover with this logic we can defined a block named "grid_column__cell" and it will be used for all columns.
We should remove this method.
Finally, we should not rely on the internal class Twig_Template for template rendering but on Twig_TemplateWrapper.
The text was updated successfully, but these errors were encountered:
Hi @APY/collaborators ,
I want to propose some improvements to the DataGridExtension, this is why I added tests with #983 PR, I want to test the current behavior before working on it.
First, the Twig blocks order for cell and filter is inconsistent:
Quote from https://github.com/APY/APYDataGridBundle/blob/master/Resources/doc/template/cell_rendering.md#overriding-block-names-ordered
As said in "Note 1" the "grid_column_%id|type%_cell" notation is "not advised". This notation is less discriminative than "grid_column_id..." and "grid_column_type..." but it is tested first in getGridCell and getGridFilter:
APYDataGridBundle/Twig/DataGridExtension.php
Lines 245 to 256 in 91b3f7f
My proposal is to trigger a deprecation when this block name is used, and then we can plan to remove it.
Second, the column's getParentType method is totally useless: it returns an empty string and is never used.
Moreover with this logic we can defined a block named "grid_column__cell" and it will be used for all columns.
We should remove this method.
Finally, we should not rely on the internal class Twig_Template for template rendering but on Twig_TemplateWrapper.
The text was updated successfully, but these errors were encountered: