I can now post forms so that my modules actions are called when I do so. The data is received and I can insert or update entries in the database, however I can’t send output back to the browser. The browser does receive a 200 http header but if my function returns output there is nothing going to the browser. Also how do I send an error message if the form doesn’t validate? I might want to send a different header in that case.
Moved to the Modules forum by Moderator
Hi Tkorrn
Are you using CI’s validation class? If so you can send back to the form using it’s build in validate functions. Note: You can’t use the redirect, you need to post to the same page you have your form at (ie. index.php/template_group/template/)
I have a smiliuar thread just below yours asking about what happens after an action is executed. I don’t think you can return anything so you need to make a redirect() or if theres a way to communicate to the templates instead of doing a page reload via redirect()
Yes, which is great for me because I just want to output a tiny bit of javascript.
If you want a template then I think that if you put this in your method:
$this->EE->load->helper('url');
redirect('/group/template/');You might just get a nice and parsed template 😊 I can’t try it now, but I will in the morning.
Yeah the redirect is working, problem with that is your forcing a page reload which isn’t working with the form validation class if in use.
I would like to do something similuar to the load->view() but for EE’s internal templates in the template-manager. Let me know if you find anything 😊
Thanks
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.