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

Fixed Problems in Vue.js Generators when using PHP7. #375

Merged
merged 1 commit into from Mar 9, 2019

Conversation

Projects
None yet
3 participants
@rascoop
Copy link
Contributor

commented Jan 19, 2017

Objects properties can not be accessed as array object['name'] but as object->name.

Fixed Problems in Vue.js Generators when using PHP7.
Objects properties can not be accessed as array object['name'] but as object->name.
@mpandar

This comment has been minimized.

Copy link

commented Sep 21, 2017

I don't recommend that. The better solution is as follows: Implementing ArrayAccess interfaces

class GeneratorField implements \ArrayAccess
{   
    public function offsetGet($key) {
        if ($key == 'fieldTitle') {
            return Str::title(str_replace('_', ' ', $this->name));
        }

        return isset($this->$key)?$this->$key:false;
    }

    public function offsetUnset($key) {
    }
    public function offsetSet($key,$value) {
    }
    public function offsetExists($key) {
        return isset($this->$key);
    }
}

@mitulgolakiya mitulgolakiya merged commit 058e9a7 into InfyOmLabs:develop Mar 9, 2019

1 check failed

continuous-integration/styleci/pr The StyleCI analysis has failed - 2 files need addressing
Details

mitulgolakiya added a commit that referenced this pull request Mar 9, 2019

fix: Fixed Problems in Vue.js Generators when using PHP7. (#375)
Objects properties can not be accessed as array object['name'] but as object->name.

mitulgolakiya added a commit that referenced this pull request Mar 9, 2019

fix: Fixed Problems in Vue.js Generators when using PHP7. (#375)
Objects properties can not be accessed as array object['name'] but as object->name.

mitulgolakiya added a commit that referenced this pull request Mar 9, 2019

fix: Fixed Problems in Vue.js Generators when using PHP7. (#375)
Objects properties can not be accessed as array object['name'] but as object->name.

@mitulgolakiya mitulgolakiya referenced this pull request Mar 9, 2019

Closed

Is Vuejs working ? #549

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.