Multi step form in cakephp3

hellow guys am member cakephp community from ETHIOPIA stuck at mult step from using cakephp3 in my project please help me?

i use this tutorial
https://bakery.cakephp.org/2012/09/09/Multistep-forms.html

my controller

//UsersController.php


<?php 
/*
this is the users controllers for citizens management system

path: src/Controller/UsersController.php
by: Ermias mesfin
used_Table: users
Templates: src/Templates/Users/*.ctp
*/
namespace App\Controller;

//used classes

use App\Controller\AppController;
//file system folder
use Cake\Filesystem\Folder;
//utility
use Cake\Utility;
use Cake\Event\Event;
use Cake\Http\Session;


class UsersController extends AppController{

	//this get the session beforeRender the layout

	public function beforeRender(Event $event){
		parent::beforeRender($event);
        
        $session = $this->getRequest()->getSession();
      
		$params = $session->read('form.params');
		$this->set('params', $params);
	}





public function msfIndex(){

	$session = $this->getRequest()->getSession();

       $session->delete('form');


}

public function msfsetup(){

	$session = $this->getRequest()->getSession();


	$cmsUsersFolder = new Folder('App'.DS.'Template'.DS.'Users');
	$steps = count($cmsUsersFolder->find('msfstep*\.ctp'));
	$session->write('form.params.steps', $steps);
	$session->write('form.params.maxProgress', 0);
	$this->redirect(array('action'=>'msfstep', 1));




}

public function msfstep($stepNumber){ 
	//check if view file exist for this step

	$session = $this->getRequest()->getSession();

	if(!file_exists('App'.DS.'Template'.DS.'Users'.DS.'msfstep'.$stepNumber.'.ctp')){
		$this->redirect('/users/msfIndex');
	}

$maxAllowed = $session->read('form.params.maxProgress') + 1;
if ($stepNumber > $maxAllowed)
{
 $this->redirect('/users/msfstep'.$maxAllowed);
}else{
	$session->write('form.params.currentStep', $stepNumber);
}
//check if data submitted

if($this->request->is('Post')){
	$this->User->set($this->request->data);
//merge data
	if($this->User->validate()){

		$privSessionData = $session->read('form.data');
		$currentSessionData = Hash::merge((array)$privSessionData, $this->request->data);

		if($stepNumber < $session->read('form.params.steps')){
			$this->Session->write('form.data', $currentSessionData);
			$session->write('form.params.maxProgress', $stepNumber);
			$this->redirect(['action'=>'msfstep', $stepNumber + 1]);
		}else{
			$this->User->save($currentSessionData);
			$session->setFlash('account Created');
			$this->redirect('/users/msfIndex');

		}

	}
}else{
	$this->request->data = $session->read('form.data');

}

$this->render('msfstep'.$stepNumber);



}







}

my template

//Users/msfstep1.ctp


<?php
?>
<?= $this->Form->create();?>
<?php echo $this->Form->control('username');?>
<?php echo $this->Form->control('e_mail');?>
<?php echo $this->Form->control('phonenumber');?>
<?php echo $this->Form->control('password');?>
<?= $this->Form->end('Next step'); ?>

and i get this error please help me???

The Form->end() don’t display the button.
Use echo $this->Form->button('Next step') and echo $this->Form->end()

i try adding button but the error stays.

what other thing should i try?
when i live the
<?= $this->Form->end();?> empty it ridrects me always to index

when i add $this->Form->end('Next step') the same error raises

You based your code on an example from 2012 and Cake 2.
Version 3 don’t have same methods.

The problem is not the view or form, it’s the logic.
try to debug your vars, sessions, etc and write new code for Cake3 by inspiring you of the example, not copy/paste it.