Welcome Guest, Not a member yet? Register   Sign In
How to extend a class from the library?
#1

[eluser]Sinclair[/eluser]
Hi,

I need to validade International characters in the Form Validation Class.

I need to change the a class function from:

Code:
function alpha($str)
{
return ( ! preg_match("/^([a-z])+$/i", $str)) ? FALSE : TRUE;
}

to

Code:
function alpha($str)
{
return ( ! preg_match("/^([*A-Za-zá-úÁ=Ú.\s*])+$/i", $str)) ? FALSE : TRUE;
}

But if I do this. The next time I upgrade Codeigniter I broke it. How can I extend this class?

PS: Newbie in OOP.


Best Regards,
#2

[eluser]2think[/eluser]
Here is a helpful section in the userguide on extending libraries

http://ellislab.com/codeigniter/user-gui...aries.html

Not sure but here is the section on Helpers, just in case you find it easier/better to make your own.

http://ellislab.com/codeigniter/user-gui...lpers.html

Hope those help some.




Theme © iAndrew 2016 - Forum software by © MyBB