-
Notifications
You must be signed in to change notification settings - Fork 53
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
Make it possible to find key/value pairs #141
Comments
I do not understand the example you've provided. That seems like a simple convenience method for "listing" the page titles. You can quickly build a PDO query in xPDO to do this as well, so a little more context would be helpful here. |
You are right, I should give a bit more context. I will do that later this week. |
In MODX for example there are various places where a "displayField" would be useful. For example, templates: In most cases we always want to show it's name. In dropdown, system settings etc. This way the "model" of the object defines how it should be displayed making it easier for others. And yes, its a convenience method but I'm sure it would be a great addition for a lot of snippet/chunks developers. |
How does that work when you wish to localize the component for another language? Having a singular displayField would seem to lock it to one language. |
In CakePHP they have behaviors. For entity/object translations you can use the TranslateBehavior. I have to dig a bit deeper into xPDO to check how this can be accomplished in xPDO. Of course I don’t want xPDO to become CakePHP, but I do find it handy how they solve this. |
I use CakePHP at work and I love how easy it is to find key/value pairs.
This would also be very useful in for example MODX. It would make it easier to show the "display name" of a system setting (like the name of the default template) instead of the value for the primary key.
Example from CakePHP:
The text was updated successfully, but these errors were encountered: