我试图在博客的每个帖子上放置一个类似facebook的按钮.代码被正确粘贴,但我收到此错误:
Refused to display 'https://www.facebook.com/undefined/plugins/like.php?action=recommend&app_id…%2F&layout=button_count&locale=pt_BR&sdk=joey&share=false&show_faces=false' in a frame because it set 'X-Frame-Options' to 'DENY'.
在facebook.com/之后有一个'undefined',我不知道为什么.
不知道如何解决这个问题?
我有一个用于注册和更新数据的表单。它工作正常,但是当我更新数据时,模型验证返回 false,因为插入的值已经存在。
我有以下代码:
/* Validation Rule*/
public $validate = array(
'unique' => array(
'rule' => array('unique', 'field in the table'),
'message' => 'The field cannot be empty.'
)
...
)
/* Function that check if the value already exists */
public function unique($value, $field) {
$check = $this->find('count', array(
'recursive' => -1,
'conditions' => array(
$this->Alias.$field => $value
)
));
return $check == 0;
}
Run Code Online (Sandbox Code Playgroud)
那么,如何禁用唯一规则,但保留其他规则?