validation dont't show message - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: validation dont't show message (/showthread.php?tid=19113) Pages:
1
2
|
validation dont't show message - El Forum - 05-28-2009 [eluser]kiyo[/eluser] hello, I'm a newbie phpframework. Today I test form_validate but it don't show error or something edit: remove unuse code validation dont't show message - El Forum - 05-28-2009 [eluser]jdfwarrior[/eluser] Why are you doing this? Code: <?php echo var_dump(validation_errors()); ?> This will work: Code: <?=validation_errors();?> Also, I'm assuming your auto loading the form validator? You don't have a load command there for it. validation dont't show message - El Forum - 05-28-2009 [eluser]kiyo[/eluser] Thank lab assistant but it not work I load form validate at constructor here this code Code: class Register Extends Controller{ validation dont't show message - El Forum - 05-28-2009 [eluser]jdfwarrior[/eluser] That's not how you call the constructor. Check the user guide on controllers. There is a section about the constructor. validation dont't show message - El Forum - 05-28-2009 [eluser]jdfwarrior[/eluser] Ok now that I'm back on a computer and not trying to reply from my phone.. The constructor is created by creating a _construct function. Code: class Register extends Controller { Making a register function doesn't mean its the constructor. To CI, its just another function. Would be accessed by navigating to: www.example.com/register/register EDIT: Nm, your code is right as well, depending on which version of PHP your using. PHP5+ uses the method I showed. via: User Guide - Controllers validation dont't show message - El Forum - 05-28-2009 [eluser]kiyo[/eluser] thank you very much I write code from guideline new screenshot << validate error don't show mesage I change a little in controller/register.php Code: class Register Extends Controller{ and this is a view/register_process.php Code: <?php echo var_dump(validation_errors()); ?> //try to dump data but it empty ,why? validation dont't show message - El Forum - 05-28-2009 [eluser]jdfwarrior[/eluser] Did you try changing the register function to being a constructor by PHP5 standards? Change the register function to be: Code: class Register Extends Controller{ validation dont't show message - El Forum - 05-28-2009 [eluser]kiyo[/eluser] sorry , that my fault after I chage constructor It show "Fatal error: Call to undefined function validation_errors() " I think we already load library >>> Test online here <<<< validation dont't show message - El Forum - 05-29-2009 [eluser]Dam1an[/eluser] The constructor should start with a double underscore Code: function __construct()... validation dont't show message - El Forum - 05-29-2009 [eluser]kiyo[/eluser] [quote author="Dam1an" date="1243601896"]The constructor should start with a double underscore Code: function __construct()... I change to function __construct() already but still don't show message. may be I mistake config or error report? at Test online program work with right way <test input more than 5 character> |