Skip to content
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

Feature Request: Multiple Key Use in PHP #6

Open
theperfectwill opened this issue May 21, 2018 · 1 comment
Open

Feature Request: Multiple Key Use in PHP #6

theperfectwill opened this issue May 21, 2018 · 1 comment

Comments

@theperfectwill
Copy link

Hi.

Maybe you thought of this when you meant from a developer's point of view... so to speak.

If not, this is a feature request.

As you know array keys are unique to their parent, but in UF they are not. They are unique globally.

The array below is how i would like to set up my array, but with UF this runs a validation error because each array key must be unique globally. So below where I have title, description, image I instead have to make them like facebook_title, facebook_description, facebook_image and twitter_title, twitter_description, twitter_image and so on.

Having to do this, with options like this can create quite a bit of extra coding because each index needs to actually be written uniquely as well.

I'm sure you understand, so I was wondering if this could be turned off for PHP, turned on for the UI only (as I see use there). I wouldn't necessarily turn it off for the UI because for newer devs or just others used to the interface, it would be good I think to help make sure they are coding uniquely, then they can change it in PHP if they decide to.

Thoughts?

[seo_settings] => Array
        (
            [search_engine] => Array
                (
                    [active] => 
                    [title] => 
                    [description] => 
                    [image] => 
                )

            [facebook] => Array
                (
                    [active] => 
                    [title] => 
                    [description] => 
                    [image] => 
                )

            [twitter] => Array
                (
                    [active] => 
                    [title] => 
                    [description] => 
                    [image] => 
                )
@theperfectwill
Copy link
Author

Hi.

I wrote this earlier and decided ot leave it for feedback and or reference.

As I thought about it... is this unique key method because of the way you need to call *_value() functions?

Meaning for the function to get the value simply, it needs to have all unique values, regardless of the array index?

If so, then I think that is ok and would be simpler overall when writing the frontend code.

Just wanted to know though.

Thanks! Appreciate it. 💯

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

No branches or pull requests

1 participant