edit values by json cake php

1

I have this as httpclient in cakephp I have this value in my index to be sent to edit, everything is fine here.

<?php foreach ($valor->articles as $article): ?>
<tr>
    <td><?= $article->id ?></td>

    <td><?= $article->title ?></td>

    <td><?= $article->body ?></td>


    <td>
        <?= $this->Form->postLink(
            'Delete',
            ['action' => 'delete', $article->id],
            ['confirm' => 'Are you sure?'])
        ?>
        <?= $this->Html->link('Edit', ['action' => 'edit', $article->id]) ?>//aca lo envio a editar
    </td>

</tr>

<?php endforeach; ?>

here to show on the screen of the edit for a var_dump.

I can already send the value, as you see on the page you see the value and that's how I have the driver.

public function edit($id = null)
{
    $http = new Client();
    $response = $http->post('http://localhost/paginaws/articles/edit', []);
    $json = $response->json;
    $json = $response->body;
    $valores = json_decode($id);

    $this->set(compact(['valores']));

until here I am trying to see all its values in the array and that it can be edited, an accessory.

    
asked by Jhon Bernal 27.06.2018 в 23:02
source

1 answer

1

Investigating I knew that sending a value should be as a post and I was sending it as a get.

    
answered by 01.07.2018 / 06:39
source