Welcome Guest, Not a member yet? Register   Sign In
New Helpers on the Wiki
#6

[eluser]bretticus[/eluser]
Apparently, this has to be a controller function or method. I wrote a wrapper function in my controller to get around it:

Code:
<?php
function check_card($card_number)
{
    $this->load->helper('cc');
    return card_number_valid($card_number);
}
?>

I suppose if somebody wants to call http://url.tld/controller/check_card/4111111111111111 they are welcome too Smile Where the call is not going to a payment gateway, I'm not worried. But still the validation class should have access to a helper I think.

Also, don't forget to define the error message:

Code:
<?php
$this->validation->set_message('check_card', '%s is invalid');
?>


Messages In This Thread
New Helpers on the Wiki - by El Forum - 08-27-2007, 01:31 AM
New Helpers on the Wiki - by El Forum - 08-27-2007, 04:48 AM
New Helpers on the Wiki - by El Forum - 06-13-2008, 03:02 PM
New Helpers on the Wiki - by El Forum - 07-02-2008, 12:03 PM
New Helpers on the Wiki - by El Forum - 07-02-2008, 03:47 PM
New Helpers on the Wiki - by El Forum - 10-27-2008, 05:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB