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

use*_*786 1 cakephp

我正面临一些问题 calling to a member function create() on a non-object

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

  <?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();
  ?>
Run Code Online (Sandbox Code Playgroud)

Vin*_*ins 5

试试这样......你在$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');
?>
Run Code Online (Sandbox Code Playgroud)