Slim (PHP) Form Example Using Post/Redirect/Get


Samuel Mortenson

I’ve been using Slim for a few months now, and have decided to create some code examples since there’s not a lot out there.

If you don’t know what Slim is, check out the Slim Framework homepage, then download my example code.

This example, which I presume will be the first in a series, will cover how you might handle forms with Slim. The entire example is only two files, one is the Slim logic and the other is a template.

Slim apps can be organized in all sorts of ways, but it does lend itself to putting all your backend code into one file. This seems counter intuitive since most web frameworks rely on MVC, which splits your code over loads of files and classes. People have adapted Slim to MVC, but it really only acts as your Router and View controller, leaving you to write everything else…

View original post 425 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s