> So, in true me fashion, I found the apparent answer immediately after
> posting. It looks like `$this->model` always reports the model
> specified in `$this->Form->create()`. Let me know if anyone knows of a
> case where my light testing could fail.
View::model will only contain the same model name if you don't specify
another name in Form::create(). That is, if you're in the Foo model's
view ... er, view, you could create a form with
$this->Form->create('Bar'). If no name is specified, Form will use the
whatever View::model is. So checking that wouldn't be bullet-proof.
I'm not sure, but you might have better accuracy with
$this->Form->defaultModel.
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment