1

hy I have code like this:

this.$http.get(domain + id, function (data) {
                  console.log(data)
                   this.$set('editData', data)
              })

I know retrieve data in vuejs like this

<span v-for="editData in editData">{{editData.name}}</span>

but my quetion is:
what I can retrieve data in looping php for example I want to do like this :

<?php foreach($editData as $editData){your data}

1 Answer 1

0

For what i understand in your question, you want to return a list of your data. you need to have an array container.

<?php 
$arr = [];
foreach($editData as $editData){
$arr[] = $editData;
}
echo json_encode($arr);
?>
Sign up to request clarification or add additional context in comments.

1 Comment

hy @jay temp thanks for your answer, but not working for me error" Undefined variable:editData

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.