When comparing Play vs Slim, the Slant community recommends Slim for most people. In the question“What are the best web frameworks to create a web REST API?” Slim is ranked 12th while Play is ranked 31st. The most important reason people chose Slim is:
Slim's documentation is well organized and detailed, every concept is thoroughly explained and it is very helpful for both advanced users and beginners.
Specs
Ranked in these QuestionsQuestion Ranking
Pros
Pro Good documentation and a great community
Play has quite a large community which provides numerous tutorials and videos related to developing with Play.
The Play official documentation covers many things, such as the framework itself but also specific stuff such as Akka, SBT and Netty.
There are also many big companies that base their main sites around Play, one of them is LinkedIn which provides third-party documentation on a regular basis.
Pro Readable code
Play framework's convention over configuration methodology makes most Play projects have a very similar structure. This means that the code written for the framework is very readable. This enables a developer to switch between applications without having to relearn the ecosystem for every project. The built-in templating system also helps with code and makes it possible to have a very low count of lines of code.
Pro Simple for beginners
Play is very simple to get started. The documentation is very helpful for beginners and advanced users alike and the official website has a great "Getting Started" tutorial to begin developing with Play.
Pro Play feautures Non-blocking I/O by default
Play Framework is asynchronous from the bottom up: asynchronous is default in Play API.
Pro Play is an extensive ecosystem
Play uses Akka for concurrency, Scala for a templating engine, Netty as a client-server framework and SBT (Simple Build Tool) for building. And they all come out of the box.
Play also comes with the option to scaffold your applications. Play is an all-embracing ecosystem designed to increase developer productivity and shorten development times.
Pro Well organized and thorough documentation
Slim's documentation is well organized and detailed, every concept is thoroughly explained and it is very helpful for both advanced users and beginners.
Pro A good starting point
Slim is minimal and that is a good thing if you want to start from there. It can be easily extended and even supports popular packages that are used in Laravel (like Illuminate\Database (eloquent)) for example.
Pro REST based
REST fans will love the REST based architecture.
Pro Supports tie-ins for Rack-like middleware
Rack is an interface used in Ruby frameworks used to group and order modules, which most of the time are Ruby classes, and specify between them.
Slim uses a simple concept for it's middleware. By wrapping HTTP requests and responses it unifies the middleware into a single method call.
Pro Useful classes
Contains classes for managing requests, responses, cookies, logging, views, HTTP caching, and more.
Pro Flexible
Slim doesn't demand that you stick to a fixed folder structure. As long as you load Slim the right way you can do anything from there the way you like it.
Pro Extremely lightweight
Paired with swoole it's a micro service powerhouse.
Pro Open source
The Slim Framework is open source and is released under the MIT public license
Pro Extremely customizable
You can add any dependency, package or class that you want to use as a contained dependency.
Pro Supports Php 5.3 and PHP 7
Pro Makes it easy to understand the way some abstract functions and classes are built
In Django most things are abstracted, you just call some function or class without knowing how they were built, but with Slim, you end up understanding the way some abstract functions and classes are built.
Pro Hooks for executing code at different points in its life-cycle
Slim supports code hooks for executing functions at different points in time during the application's lifecycle.
Cons
Con Awkward, non-idiomatic Java API
Con Backward incompatibility
The jump from Play 1 to Play 2.x caused a lot of confusion. While it is important to have some kind of evolution, sometimes it causes backward incompatibility which can create some problems. It makes tutorials or modules made for the old version obsolete. This can make it hard for beginners to find useful resources. The template engine which used Groovy now uses Scala.
Con Very little consistency among different versions
There have been quite some changes that break the compatibility between Slim 2 and Slim 3. Even if you learned how to work with the Slim 2, you will find that Slim 3 requires re-training.
Con Dependency injection is too weak
It is not really dependency injection, but just a configurable container.
Con Needs strong bases to create dependencies
The dependency container schema of Slim is one of the biggest PROS and CONS of the framework. It is true that this schema brings so much flexibility to add anything, but another thing that is true is that you need to have strong bases of patterns, and an extensive knowledge of your libraries to convert it into a Slim dependency.
Con Too minimal
While it's true that Slim is a microframework, it's still too minimal. When used for throwaway projects or simple prototypes, it's perfect. But in the long run, it becomes less and less useful and you end up in implementing a full custom framework in trying to tackle all the missing features.