因为我在我的项目中写下了代码。以下代码是我的添加文件代码
<?php $options = array('url' => array( 'controller' => 'users', 'action' => 'is_exist'), 'update' => 'email_exist');
echo $this->ajax->observeField('UserEmailId',array('url' => array( 'controller' => 'users', 'action' => 'is_exist'), 'update' => 'email_exists')); ?>
在我的控制器中,我创建了一个像
这样的功能 public function is_exist($id = null)
{
$result = "yes";
$this->set('existdata',$result);
}
我还在view / uers中创建了is_exists.ctp fiel。 我不知道为什么它不起作用。 我在Cakephp 1.3及其工作文件中做了同样的事情,但没有在cakephp 2.0中做过 谁能告诉我我是如何实现这一点的? 提前谢谢