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

SlimPHP Use Cases

kullmann.david's Avatar

kullmann.david

03 Aug, 2012 06:26 PM

Hello, I'm a user of a few different PHP frameworks but I have some trouble distinguishing what the proper use cases for them would be vs. when SlimPHP is a better fit.

Examples of other frameworks I use are CakePHP and Lithium. I know another popular one is CodeIgnighter. It would be interesting to hear what the best use case is fro SlimPHP from some SlimPHP enthusiasts!

  1. Support Staff 1 Posted by Brian Nesbitt on 03 Aug, 2012 08:13 PM

    Brian Nesbitt's Avatar

    I don't think that Slim is not a viable option for a larger project. However the opposite isn't as true for the frameworks mentioned with a smaller one page project.

    The difference is the mentioned frameworks already supply out of the box answers for all of the components you might need (just read http://codeigniter.com/user_guide/toc.html) and typically enforce a methodology on the developer to aid in the project maintaining some sort of sanity.

    Slim on the other hand is mostly a thin routing layer. It doesn't provide an ORM or data layer, html helpers, out of the box scaffolding/CRUD, authentication system, file system helpers, advanced view templates etc. etc. This lets you pick from the best of the best out there rather than using (read: being stuck with) what exists in the framework. Many developers like the freedom. It does leave the responsibility to the developer to maintain good project structure and organization. There are a few questions on this forum with that exact topic and also examples on how others built controllers on top of the Slim routing. You can also read a blog post here on the subject: http://www.slimframework.com/read/how-to-organize-a-large-slim-fram...

    I'll include this excerpt from my first blog post on Slim:
    It has been said that if there are n PHP developers in the world then there are n+1 PHP frameworks. While that is most likely undeniably true, I have been perusing the so-called micro frameworks lately of which most are inspired (at least in part) by sinatra. I tend to enjoy working with the micro frameworks as they typically don't get in your way but just gently get you going. They don't force a whole stack on you as you generally select your best components (view engine, datastore, etc) and piece them together. For me it helps to quickly gain a good understanding of the framework and its inner workings and makes it easier to go through its source since its not trying to be everything to everyone. On the Slim homepage it even says, and I believe it to be true so far "The Slim micro framework is everything you need and nothing you don't."

    http://nesbot.com/2012/6/8/PHP-on-a-diet-up-and-running-with-slim

  2. 2 Posted by kullmann.david on 03 Aug, 2012 11:07 PM

    kullmann.david's Avatar

    Brian:

    Fantastic. That was my suspicion but all the frameworks I've used have been
    fully MVC.

    So a typical use case might be that I want to select my ORM and select my
    authentication system in order to gain flexibility, whereas I might use
    CakePHP for a more run-of-the-mill project in which I just need to get up
    and running fast and I can live within the confines of the existing
    architecture.

    Thanks for the link to the blog - I will check it out!

    -DK

  3. Andrew Smith closed this discussion on 20 Nov, 2012 12:55 PM.

Comments are currently closed for this discussion. You can start a new one.

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