Cakephp 3输入为空以进行编辑

So I'm tryng to create an edit functionality and it seems that when I press the edit button it redirects me to the edit page with the correct id but all the inputs are empty....any ideas why?

public function edit($id=null) {

   $user =$this->Users->get($id); 

    if ( !$this->Users->exists($user) ) {
        throw new NotFoundException( __( 'Invalid user' ) );
    }

    if ( $this->request->is( 'post' ) || $this->request->is( 'put' ) ) {
         $user = $this->Users->patchEntity($user, $this->request->data);

         $query = $this->Users->find( 'all', array( 'conditions' => array( 'id' => $id) ));
         $aros = $query->first()->toArray();

        $save = $this->Users->save( $this->request->data );

        if ($save) {

            $this->Flash->success( 'The user has been saved');

        } else {
            $this->Flash->error( 'The user could not be saved. Please, try again.');
        }}

You didn't paste all required code so here two guesses:

  1. You don't set the entity to the view
  2. If you set it you need to pass it to the form create() as well
  3. You are missing a patchEntity() call as well before save()
  4. You need to pass an entity to save()

I recommend you to do the basics tutorials on book.cakephp.org, it doesn't look like you have any idea how it works at all based on the pasted code and what you want to do.