validation dont't show message |
[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
[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.
[eluser]kiyo[/eluser]
Thank lab assistant but it not work I load form validate at constructor here this code Code: class Register Extends Controller{
[eluser]jdfwarrior[/eluser]
That's not how you call the constructor. Check the user guide on controllers. There is a section about the constructor.
[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
[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?
[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{
[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 <<<<
[eluser]Dam1an[/eluser]
The constructor should start with a double underscore Code: function __construct()...
[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> |
Welcome Guest, Not a member yet? Register Sign In |