Extending Native Libraries: solved |
[eluser]nirbhab[/eluser]
My Library: Code: <?php Quote:Fatal error: Class 'CI_Validation' not found in /opt/lampp/htdocs/foodcourt/system/application/libraries/Validation.php on line 3 Any solution, or mistake i am doing?
[eluser]GSV Sleeper Service[/eluser]
are you autoloading the validation library?
[eluser]GSV Sleeper Service[/eluser]
hmmm, no idea, sorry. I've just copied your code above and it works fine. what is your $config['subclass_prefix'] set to? if it's the default 'MY' then your library should be named MY_Validation.php
[eluser]GSV Sleeper Service[/eluser]
what is your $config['subclass_prefix'] set to? if it is still set to the default 'MY_' then this explains your problem
[eluser]Seppo[/eluser]
[quote author="nirbhab" date="1206721359"]File name is: Validation.php[/quote]That is the problem. Rename it to MY_Validation.php If you name it Validation.php CI "thinks" you overwrite the navtive validation class with one of your own. To extend it the filename must start with the prefix. Read Creating Libraries, specially the "Extending Native Libraries" section for more info.
[eluser]nirbhab[/eluser]
Thanks to all of you! filename renamed to: My_Validation.php I haven't checked whether my validations working or not, but i think error has resolved...so it won't further disturb :-), else i wud disturb u all again :-) |
Welcome Guest, Not a member yet? Register Sign In |