Forms Cakephp在单个视图中显示多个表单

Forms Cakephp在单个视图中显示多个表单,forms,cakephp,Forms,Cakephp,在“编辑”视图中,我创建了两个表单: <?php echo $this->Form->create('EditPasswordUserForm')); ?> <?php echo $this->Form->create('EditInfoUserForm')); ?> 及 控制器用户: public function edit($slug) { $this->loadModel('EditPas

在“编辑”视图中,我创建了两个表单:

<?php echo $this->Form->create('EditPasswordUserForm')); ?>
<?php echo $this->Form->create('EditInfoUserForm')); ?>

控制器用户:

public function edit($slug)
{                   
    $this->loadModel('EditPasswordUserForm'); 
    $this->loadModel('EditInfoUserForm');
    $editpassword = $this->EditPasswordUserForm->findBySlug($slug);
    $editinfo = $this->EditInfoUserForm->findBySlug($slug);

    if(empty($this->data))
    {
        $this->request->data['EditPasswordUserForm'] = $editpassword['EditPasswordUserForm'];
        $this->request->data['EditInfoUserForm'] = $editinfo['EditInfoUserForm'];   
    }

}//end edit
我收到了以下错误消息: 错误:找不到类“用户” Fichier:C:\xampp\htdocs\projectmvc\app\Model\EditPasswordUserForm.php

你能帮帮我吗

多谢各位
Ligne:4

您只需在扩展模型中导入
用户
模型,如

App::import('Model', 'User');
class EditPasswordUserForm extends User
{
    //
}


要获得最佳文档,请阅读

,您不需要创建两个类

您只需执行以下操作:

echo $this->Form->create('User', array('action' => 'editPw'));
echo $this->Form->create('User', array('action' => 'editInfo'));
在UsersController中:

class UsersController extends AppController {
     public function editPw() {...}
     public function editInfo() {...}
}

你的用户类的代码在哪里?我知道了!我只是在编辑功能中使用模型“User”。我想我们至少应该用一次。非常感谢。
App::import('Model', 'User');
class EditInfoUserForm extends User
{
  //
}
echo $this->Form->create('User', array('action' => 'editPw'));
echo $this->Form->create('User', array('action' => 'editInfo'));
class UsersController extends AppController {
     public function editPw() {...}
     public function editInfo() {...}
}