データベースに情報を保存するフォームを作成しようとしています...かなり簡単に聞こえますが、ドキュメントが面倒です(または私はそれほど賢くありません)。送信時にいくつかのパラメーターを送信したいだけで、反対側のキャッチでそれらをデータベースに保存します....
だから、私はこれをしました:
私の中でcomponent/views/myview/tmpl/default.php
私はこれを書きました:
<form action="index.php">
<input type="submit" value="test" />
</form>
次に、ファイルview.html.php
に移動して/mycomponent/view/component/view.html
、これを行います。
$this->get('SaveClient');
私のモデルでは、これを行いました(試してみるためだけに):
public function getSaveClient(){
$query ="
Insert into client ( `id_client` ,`test`)
VALUES
(NULL , '1')
";
$db = & JFactory::getDBO();
$db->Execute($query);
}
しかし、それでも..機能しません。機能させる方法はありますか??
ありがとう!