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
Short description of what this feature will allow to do:
Add addDisplayOnPage(string $pageName) in src/Field/FieldTrait.php
Adding the addDisplayOnPage(string $pageName) method to the src/Field/FieldTrait.php trait allows adding a field to a "page" other than EDIT INDEX DETAIL NEW. These other pages can be, for example, CSV or WHATEVER.
Example of how to use this feature
#src/Controller/Admin/MyCrudController.php
[...]
public functionconfigureFields(string $pageName): iterable
{
yield TextField::new('field')
->addDisplayOnPage("CSV")
->hideOnIndex()->hideOnForm()->hideOnDetail();
}
# And in another method, We retrieve only fields of CSV PAGE
public function export(AdminContext $context): Response
{
//$context->getCrud()->setPageName("CSV");
//
}
The text was updated successfully, but these errors were encountered:
ceponcet
added a commit
to ceponcet/EasyAdminBundle
that referenced
this issue
Jun 5, 2024
In order to be consistent with existing method names, I suggest to rename addDisplayOnPage(string $pageName) into onlyOn(string $pageName) + another hideOn(string $pageName)
Short description of what this feature will allow to do:
Add
addDisplayOnPage(string $pageName)
insrc/Field/FieldTrait.php
Adding the
addDisplayOnPage(string $pageName)
method to thesrc/Field/FieldTrait.php
trait allows adding a field to a "page" other than EDIT INDEX DETAIL NEW. These other pages can be, for example, CSV or WHATEVER.Example of how to use this feature
The text was updated successfully, but these errors were encountered: