The Slim Framework support forum has moved to http://discourse.slimframework.com. This Tender forum is no longer maintained or monitored.

Submit a form to a specific route

Jens's Avatar

Jens

29 Jun, 2015 06:53 PM

Hi!

I very excited from this framework. I tried a lot and had quick successes. But one problem remains.
If i submit a form it looks like this

 <form name="tickets-form" action="" method="post" enctype="multipart/form-data">

and my actual get route is

$app->get('/kassecp/cashbox', function() use ($app, $config, $conn)

i use

$app->post('/kassecp/cashbox', function() use ($app, $config, $conn)

to process the form.

But what if i want to use an other post route? (Because i have 2 different forms on my page).

I tried

 <form name="tickets-form" action="'/kassecp/cashbox/buy" method="post" enctype="multipart/form-data"> 
$app->post('/kassecp/cashbox/buy', function() use ($app, $config, $conn)

but that get me a 404 error. What is the solution for that problem?

Thank you for your responses.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac