Re: Cannot access empty property in View.php on line 854
$this->Form (uppercase F)
On Wed, Jun 12, 2013 at 11:19 PM, alfredo davila <davilaassadalfredo@gmail.com> wrote:
ok, this is my View call add.ctp<h2>Create an Account</h2><?phpecho $this->$form->create('User', array('action' => 'add'));echo $this->$form->input('username');echo $this->$form->input('password', array('type' => 'password'));echo $this->$form->input('password_confirm', array('type' => 'password'));echo $this->$form->submit();echo $this->$form->end();?>my Model<?phpclass User extends AppModel{var $name = 'User';}?>
and my Controller<?phpclass UsersController extends AppController{var $name = 'Users';# needed for 'register'var $helpers = array('Html', 'Form');public function index(){}function add() {if (!empty($this->data)) {if ($this->data['User']['password'] == $this->Auth->password($this->data['User']['password_confirm'])){$this->User->create();if($this->User->save($this->data)){$this->Auth->login($this->data);$this->redirect(array('action' => 'index'));}}}}}?>
El lunes, 10 de junio de 2013 18:20:21 UTC-5, alfredo davila escribió:I can´t stop dealing with this problem in my cakephp :S I think it´s problem of the Model or the View.Can anyone help me? :S--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home