1 つずつ割り当てるのではなく、datamapper オブジェクトのすべての属性を自動的/動的に設定する方法はありますか?
したがって、私のフォーム フィールド名は、datamapper モデルの属性とまったく同じです。
これを行うためのより短い方法はありますか:
function add() {
if( $this->input->post('client-add')) {
$c = new Client();
$c->name = $this->input->post('name');
$c->email = $this->input->post('email');
// and so on for about 20 more properties
$c->save();
}}