Form Validation in a /folder/controller/method doesn't work? |
[eluser]dimas[/eluser]
Hi all, I'm new to CodeIgniter and I'm stuck with a form validation problem. Until now I made some forms with validation using Form Validation library with no problems, but this one isn't working. - I've the controller that call the view with the form (function new_product()) and save the data (function save_product()) in "controllers/user/products.php". - The view with the form is in "views/user/products/new_product.php". - The config for the validation is inside "config/form_validation.php". If I move the controller to the parent directory (controllers/product.php) and update the form_open and the form_validation config the validation works!! But the same inside the controllers/user directory doesn't work. Do you know why?? My files resumed: - Controller controllers/user/products.php - Code: public function new_product() - Form view views/products/new_product.php - Code: ... - Configuration config/form_validation.php - Code: ...
[eluser]Herlevsen[/eluser]
What uri are you calling the controller from? You do realise that you will have to include the folder in the uri right? Code: http://www.yoursite.com/user/product
[eluser]TheFuzzy0ne[/eluser]
You mentioned that the file is named "product.php", but your URI says users/products (plural). Is that a typo?
[eluser]dimas[/eluser]
[quote author="TheFuzzy0ne" date="1367513720"]You mentioned that the file is named "product.php", but your URI says users/products (plural). Is that a typo?[/quote] Yes, it was an error writing the post, but the file is 'products.php', that's correct. [quote author="Herlevsen" date="1367511272"]What uri are you calling the controller from? You do realise that you will have to include the folder in the uri right?[/quote] See the files, I think the uri's are correct.
[eluser]dimas[/eluser]
I've found the answer here: http://ellislab.com/forums/viewthread/151353/ |
Welcome Guest, Not a member yet? Register Sign In |