I have a User model has a validation method
->add_rule('unique','users.username');
........
etc.
there are still some fields that the user fills
How do I make such a check if the user wants to change my username or email, not all fields are checked
if ($val->run(null, true))
{
echo 'Success';
}
else
{
\Session::set_flash('error', $val->error());
}
The field Username must be unique, but LOGIN has already been used
How do I ignore the Username field if the input data does not differbut to some other field tested method of validation
I think it is not safe to rely on the hidden id field in the form
I wanted to do something like this
public function action_account()
{
\Sentry::check() or \Response::redirect('/');
try
{
$user = \Sentry::getUser();
$val = Model_User::validate('edit');
if ($user->username == \Input::post('username'))
{
need to remove the value of \Input::post(); with a key username
}
// Is there any way to do this?
Thanks, that's what you need
$val->field('username')->delete_rule('unique');
It looks like you're new here. If you want to get involved, click one of these buttons!