• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
valid_email

#1
If my email field is not a required field I still get an error message when the user leaves the email field empty. The valid_email rule should not return an error in this case. If it is required then the rule would be required|valid_email. valid_email is impossible to use if it is not required. I had to make my own. I think CI3 works properly?
Simpler is always better
Reply

#2
No, rules are independed and do not run based on the outcome of other rules.
An empty value is not a valid email. So it does do what it should do.
Reply

#3
Then there should be a "nullable" rule to fix this problem. (I believe Laravel does this)
Simpler is always better
Reply

#4
Then Laravel is doing it wrong!

What happens if you try to send an email without an email address?

CodeIgniter is doing it the correct way.
What did you Try? What did you Get? What did you Expect?

Joined the CodeIgniter Community in 2009.          ( Skype: insitfx )
Reply

#5
(04-14-2018, 04:11 AM)InsiteFX Wrote: Then Laravel is doing it wrong!

What happens if you try to send an email without an email address?

CodeIgniter is doing it the correct way.

There is more than one way. Your reasoning is wrong.

PHP Code:
if(checkIfEmailExist) {
    
sendEmail();

...
Reply

#6
@Paradinight

I understand that, I was just pointing out that CI was not wrong.

If you give the same problem to 10 different programmers you will get 10 different results.
What did you Try? What did you Get? What did you Expect?

Joined the CodeIgniter Community in 2009.          ( Skype: insitfx )
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2018 MyBB Group.