Here is my current code. The problem is Trongate does not get to to correct controller function.
Thanks, Dan
Handling multiple submit buttons
10 months ago
10 months ago
#1
10 months ago
#2
★ Winning Post! ★
The thread creator has indicated that this post solved the problem or provided the best insight.
Members who post winning responses earn points for our leaderboard.
Points mean prizes!
Great to see you back on the forums again 🙂
I hope all is well in your world.
I think there might be a bit of confusion about how forms work. In this example:the `action` will always be `tgmm/submit`, regardless of which `form_submit()` button is clicked. That means all buttons will trigger the submit method, not any method named after the button label or name.
To handle different actions, you'll need to check the `$_POST` superglobal directly, or better yet, use Trongate's `post()` method.
Here's a sample controller method that does what you're after. I’ve added a simple check inside the `generate_module()` method to demonstrate where you could insert validation:Hope this helps, cheers!
10 months ago
#3
Thanks Simon, I have been having a time explaining to the employee of the month to understand the Trongate documentation.
All is great, I have been working on a module generate from imputing a create sql statement.
Dan
EDIT
After working with this a bit. I decided to implement this code:
All is great, I have been working on a module generate from imputing a create sql statement.
Dan
EDIT
After working with this a bit. I decided to implement this code:
10 months ago
#4
No problem, Dan. I'm currently working on converting the Trongate documentation into a more AI-friendly format. Once I find some spare time, I’ll finish it off and let you know.
At this stage, I’m about 80% through building a module that processes all the tg_docs, stripping out the JavaScript that dynamically injects HTML. I also need to convert the remaining code blocks.
The final output will be in Markdown, making it much easier to index into a vector database, feed into an LLM, or use with tools like MCP or Context7.
At this stage, I’m about 80% through building a module that processes all the tg_docs, stripping out the JavaScript that dynamically injects HTML. I also need to convert the remaining code blocks.
The final output will be in Markdown, making it much easier to index into a vector database, feed into an LLM, or use with tools like MCP or Context7.