Skip to content

Add copy button to get path of variable deep down the array/object chain #52345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Schrank opened this issue Oct 28, 2023 · 6 comments
Open

Comments

@Schrank
Copy link

Schrank commented Oct 28, 2023

Description

I hope this is the right repo and there is not already an issue (or even better the feature implemented).

I just find myself implementing twig templates and use {{dump() }} often, because the object hierarchy is deep. When I'm 5 or 6 objects deep I would love to be able to click something, e.g. the # in front of each line to get the path (educated guess would be good enough) to the object/property. Currently I need to climb down the tree and make sure to not mix up levels.

Example

I try my best :-) In Shopware 6 we have this tree:

Shopware\Core\System\SalesChannel\SalesChannelContext {#2206 ▼
  #extensions: 
  #token: "hB6gmStYww7V5sZFM7wy6Cis0Jy475YU"
  #currentCustomerGroup: Shopware\Core\Checkout\Customer\Aggregate\CustomerGroup\CustomerGroupEntity {#4444 ▶}
  #currency: Shopware\Core\System\Currency\CurrencyEntity {#3330 ▶}
  #salesChannel: Shopware\Core\System\SalesChannel\SalesChannelEntity {#2791 ▶}
  #taxRules: Shopware\Core\System\Tax\TaxCollection {#3179 ▶}
  #customer: Shopware\Core\Checkout\Customer\CustomerEntity {#3824 ▼
    #extensions: array:1 ▶
    #_uniqueIdentifier: "018b71ecb589709f9a7fafed0db2452b"
    #versionId: null
    #translated: 
    #createdAt: DateTimeImmutable @1698423420 {#4355 ▶}
    #updatedAt: DateTimeImmutable @1698423420 {#4356 ▶}
    -_entityName: "customer"
    -_fieldVisibility: Shopware\Core\Framework\DataAbstractionLayer\FieldVisibility {#3930 ▶}
    #groupId: "cfbd5018d38d41d8adca10d94fc8bdd6"
    #defaultPaymentMethodId: "125f1eb6116b4fab86dd7bc12e9a4419"
    #salesChannelId: "018b3c3a156c70e3821535fa6f182317"
    #languageId: "2fbb5fe2e29a4d70aa5854ce7ce3e20b"
    #lastPaymentMethodId: null
    #defaultBillingAddressId: "018b71ecb589709f9a7fafed0e348824"
    #defaultShippingAddressId: "018b71ecb589709f9a7fafed0e348824"
    #customerNumber: "10011"
    #salutationId: "018b3c38f986720a963fca2aec76383e"
    #firstName: "Fabian"
    #lastName: "Blechschmidt"
    #company: null
    #password: null
    #email: "fill-me-in@example.org"
    #title: null
    #vatIds: null
    #affiliateCode: null
    #campaignCode: null
    #active: true
    #doubleOptInRegistration: false
    #doubleOptInEmailSentDate: null
    #doubleOptInConfirmDate: null
    #hash: null
    #guest: true
    #firstLogin: DateTimeImmutable
[...]

I would love to click on #firstName and find context.customer.firstname in the clipboard.

@carsonbot
Copy link

Thank you for this suggestion.
There has not been a lot of activity here for a while. Would you still like to see this feature?

@Schrank
Copy link
Author

Schrank commented Apr 29, 2024

Hi @carsonbot, yes I still think this is helpful, the deeper the structure.

@carsonbot carsonbot removed the Stalled label Apr 29, 2024
@carsonbot
Copy link

Thank you for this suggestion.
There has not been a lot of activity here for a while. Would you still like to see this feature?
Every feature is developed by the community.
Perhaps someone would like to try?
You can read how to contribute to get started.

@carsonbot
Copy link

Hello? This issue is about to be closed if nobody replies.

@Schrank
Copy link
Author

Schrank commented Nov 13, 2024

I still think it is helpful and would love to implement this, if there is a chance to get it merged?

@carsonbot carsonbot removed the Stalled label Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants