首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >cakePHP 1.3 :使用Ajax渲染问题

cakePHP 1.3 :使用Ajax渲染问题
EN

Stack Overflow用户
提问于 2012-03-21 13:50:47
回答 1查看 417关注 0票数 0

我希望在我的ajax响应中包含一个字符串形式的元素。

因此,我将以下代码放入了我的控制器操作中

代码语言:javascript
复制
$view = new View($this, false);
$view->viewPath = 'elements/private_challenge/';            
$res = $view->render('supporters_list_supporter');

现在,在我的supporters_list_supporter.ctp中,我放置了一个表单,如下所示:

代码语言:javascript
复制
echo $this->Form->create('RequestFrHelpReply',array('action'=>'add_helpreq_reply','class'=>'form','id' => 'helprequestreplyaddfrm','name'=>'helprequestreplyaddfrm')); 

 echo $this->Form->hidden('PrivateChallengeRequestHelp.ReqID',array('value'=>$supporterlist['RequestFrHelp']['REQID']));
 echo "<div class='alignleft'>";
 echo $this->Form->input('PrivateChallengeRequestHelp.txt_helpreq_reply', array('label'=>false,'type' => 'textarea', 'id'=>'txt_helpreq_reply','escape' => false, 'div' => false, "class"=>"textarea request-help-textarea",'onKeyDown'=>'textCounterComment(this.form.txt_helpreq_reply,this.form.remLenth,'.Configure::read('CommentSetting.comment_body_max_limit').',\'remLenthDiv\');', 'onKeyUp'=>'textCounterComment(this.form.txt_helpreq_reply,this.form.remLenth,'.Configure::read('CommentSetting.comment_body_max_limit').',\'remLenthDiv\');'));
  echo "</div>";
  echo '<span class="request-arrow"></span><span class="user-name"> : '.$html->get_users_username($session->read('Auth.User.id')).'</span>';
 echo $html->link(__l('Reply'),'#',array('id'=>'helpreq_reply_link','class'=>'request-help-button alignleft','title'=>__l('Reply'),'escape'=>false,'onclick'=>'helpreq_reply(\'reply\');return false;'));               
 echo "</div>";     
 echo $this->Form->end();

所以它给了我一个与表单助手丢失相关的错误,所以有人能帮我添加这个外部对象的表单助手吗?

更新:错误消息:

代码语言:javascript
复制
   $view = stdClass
   stdClass::$modelScope = false
   stdClass::$entityPath = "RequestFrHelpReply."</pre><pre class="stack-trace">Helper::setEntity() - CORE\cake\libs\view\helper.php, line 422
   FormHelper::create() - CORE\cake\libs\view\helpers\form.php, line 217
   include - APP\views\elements\private_challenge\help_request_form.ctp, line 21
EN

回答 1

Stack Overflow用户

发布于 2012-03-21 14:07:56

你有没有

public $helpers = array('Form');

在你的控制器里?

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9799257

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档