cakephp-在非对象上调用成员函数create()

我面临在非对象上调用成员函数create()的一些问题

请帮帮我,我的代码是:-

  <?php
     echo $form->create('Register', array('action' => 'register'));
     echo $form->input('username');
     echo $form->input('password');
     echo $form->input('cnfrmpassword', array('type' => 'password'));
     echo $form->submit();
     echo $form->end();
  ?>
最佳答案
尝试这样….您缺少$this->在帮手之前.

<?php
     echo $this->Form->create('User', array('action' => 'register'));
     echo $this->Form->input('username');
     echo $this->Form->input('password');
     echo $this->Form->input('cnfrmpassword', array('type' => 'password'));
     echo $this->Form->end('Submit');
?>

转载注明原文:cakephp-在非对象上调用成员函数create() - 代码日志