![]() |
internal message system message send form - 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: internal message system message send form (/showthread.php?tid=26549) |
internal message system message send form - El Forum - 01-16-2010 [eluser]mabright[/eluser] I am working on an internal message system for my application and I have a compose message view that is at mysite.com/messages/compose. On this form I have the post action as <?php echo current_url().'/send'; ?>. I expect this to call my the compose method in my controller with a parameter of 'send' and that I can process the send logic accordingly. The form submit (which is using a standard form button) just re-submits my compose page with /send in the URL instead of returning my test message that I put in place to see if the parameter is being passed. Controller code below: Code: public function compose($action = '') Am I doing this the correct way? internal message system message send form - El Forum - 01-16-2010 [eluser]Aken[/eluser] What happens if you go to the send page directly, IE type the URL into your browser. Does your test message pop up? If not, then it's not the form's problem. Your code looks okay from what I can tell, but I haven't tested anything and could be missing something. A better description of what is not happening that should be would help some. internal message system message send form - El Forum - 01-16-2010 [eluser]mabright[/eluser] Below is my compose message view. I put a test variable($test_msg) in the view that I expect to print when my logic in the controller is called via the submitted "send message" button. I am new to CI and still testing the whole segment/parameter url logic. Code: <div id="mc_container"> internal message system message send form - El Forum - 01-16-2010 [eluser]Aken[/eluser] Okay, so what happens if you go to site.com/messages/compose/send directly, not through the form? Does the message appear? I just tested your code minus the current_url() helper (kept giving me the example.com URL instead, not sure why), and hitting the button set the $action variable for me no problem. internal message system message send form - El Forum - 01-16-2010 [eluser]mabright[/eluser] Going directly to the send function, does not display the message. I really just wanted to make sure my way I was using mvc was correct, i will keep trying to get the message to print. it's probably something small. thanks. |