私は CakePHP (バージョン 2.4) に単純なフォームを持っています。ブラウザーで URL を開くと、すべて問題ありません。フォームは、初めて [送信] をクリックした後にのみ検証されます。しかし、同じフォームを Facebook アプリ内に (ページ タブとして) 配置すると、同じフォームがすぐに検証され、ユーザーが [送信] をクリックする前にすべてのエラーが出力されます (もちろん、最初の読み込みではすべての必須フィールドが空であるため)。
フォーム追加の私のコントローラー:
public function add($id = null) {
$this->set('title_for_layout', "Fb Form");
if (!empty($this->data)) {
$this->Application->create($this->data);
if ($this->Application->save()) {
$this->Application->saveField('fbapp_id', $id);
$this->Session->setFlash('Form saved');
$this->redirect(array('action' => 'add'));
} else {
$this->Session->setFlash('Form not saved');
}
}
}
どんな助けでも大歓迎ですので、事前にthnxしてください!