user786
user786

Reputation: 391

calling to a member function create() on a non-object

I am facing some problem of calling to a member function create() on a non-object

please help me out,My code is :-

  <?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();
  ?>

Upvotes: 1

Views: 5015

Answers (1)

Vinayak Phal
Vinayak Phal

Reputation: 8919

Try like this.... You're missing $this-> before the helper.

<?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');
?>

Upvotes: 5

Related Questions