<?php
$id = $_GET['id'];
if(empty($id)){$id = 1;}
$customer = new \customer();
$customer->get_by_id($id);
if($this->request->is_post()){
$customer->set_data($_POST); // yes, it's no problem to use the global variable
if($customer->save()){
$this->view->flash('Your object is saved.', 'success');
}
}
$this->view->customer = $customer;
<?php $customer->get_form()->panelize($customer->get_form())->render()?>