0

I'm upgrading a system from CakePHP 1.1 to CakePHP 1.3. In 1.1 I was able to use the HTML helper to do something like:

$html->input('User/email');

To get back data nested in:

$this->data['User']['email']

In the controller. Now I know that $html->input() has been replaced with $this->Form->input(). However, when I try to use:

$this->Form->input('User/email')

I get:

Undefined offset: 2 [CORE\cake\libs\view\helpers\form.php, line 496]

This is coming up because the / in the input. So it seems that 1.3 doesn't like using the / to specify the data should be returned nested. How might I achieve the equivalent of this in 1.3? Thank you much!

1 Answer 1

1

In 1.3 you would use

$this->Form->input('User.email');

To set an input for the User model and the email field.

If you have set up your form correctly though, you just need email

For example

$this->Form->create('User');

$this->Form->input('email');

$this->Form->end('Submit');

But in short, to answer your specific question, replace the / with a .

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.