protected static $_properties = array(
'id',
'username' => array(
'validation' => array('required')
),
'password' => array(
'validation' => array('required')
),
'email' => array(
'validation' => array('required', 'valid_email')
),
'active' => array(
'default' => 0
)
};
echo Form::checkbox('data[active]', 1);
$user = Model_User::forge();
$user->username = Input::post('data.username');
$user->password = sha1(Input::post('data.password'));
$user->email = Input::post('data.email');
$user->active = Input::post('data.active');
$user->profile = Model_Profile::forge();
$user->profile->profile = Input::post('data.profile');
$user->save();
// make the current value of $user->active the 'default' return value of Input::post() when the requested key isn't found
$user->active = Input::post('data.active', $user->active);
// Similar to the above but default to zero
$user->active = Input::post('data.active', 0);
// Only set when input is found
Input::post('data.active') and $user->active = Input::post('data.active');
It looks like you're new here. If you want to get involved, click one of these buttons!