现在我正在尝试创建一个简单的应用来查看和添加注释。我真正做的只是复制一些代码,我需要从帖子/用户那里获得(http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-example/auth.html)
的食谱教程在“添加”页面,它告诉我“NoteHelper”缺失,所以我在View / Helper下创建了一个空白的“NoteHelper.php”类。
答案 0 :(得分:1)
为Notes创建MVC的最佳方法是使用Console / bake 在“添加页面”上仔细检查表单,它应该看起来像
<?php
echo $this->Form->create('Notes'); ?>
<fieldset>
<legend><?php echo __('Add Notes'); ?></legend>
<?php
echo $this->Form->input('note_title');
echo $this->Form->textarea('note_description');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit')); ?>
错误发生了,因为你使用了$ this-&gt; Notes-&gt; input('');