News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Rob Allen:
Using ZendConfig with a Slim app
April 21, 2015 @ 09:11:31

Rob Allen has a quick post to his site continuing his theme of Slim framework-related posts with this new post showing how to use the ZendConfig module with a Slim application.

Sometimes you need more configuration flexibility for your application than a single array. In these situations, I use the ZendConfig component which I install via composer: composer require "zendframework/zend-config". This will install the ZendConfig component, along with its dependency ZendStdlib.

He shows how to use the glob function to have the component load a set of configuration files and the order they'd load in. He also points out that the ZendConfig component supports other formats including YAML and JSON data. He also includes a code example showing how you can load multiple formats at the same time (ex. some .php files and some .yml files with one call).

0 comments voice your opinion now!
slim application zendframework2 config component zendconfig tutorial introduction

Link: http://akrabat.com/using-zendconfig-with-a-slim-application/

Slim Framework Blog:
Lumen
April 17, 2015 @ 09:34:17

Josh Lockart, the lead developer and creator of the Slim framework, has responded to some questions and comments around the recently released Laravel microframework Lumen and how it relates to Slim and its own goals.

Lumen happened. It's a shiny new micro-framework from Taylor Otwell, and it joins the Laravel family today. It looks to be a pretty nice framework, and it shares many of the same features and goals as Slim 3.0. I'm sure this raises a few question about Slim's future roadmap. [...] Is there overlap between Slim and Lumen? Of course. They both have similar goals and solve similar problems. There are also differences.

He talks about some of the current work being done on version 3.0 of Slim, the PSR-7 support it offers and some of the differences between Slim and Lumen. He points out two main ones: that Slim has fewer dependencies and that it is a supporter of the PSR-7 HTTP interoperability standard. Josh talks about why you might choose Lumen over Slim and that, in the end, he welcomes alternative microframeworks and challenges the Slim community to help consistently improve Slim and its place in the community.

0 comments voice your opinion now!
slimframework slim lumen respond opinion framework laravel microframework

Link: http://www.slimframework.com/2015/04/14/lumen.html

Rob Allen:
Logging errors in Slim 3
April 07, 2015 @ 10:57:36

Rob Allen continues his posts looking at the use of the Slim PHP framework with this new post about logging errors.

Slim Framework 3 is being actively developed at the moment and has a number of changes in it, including the use of the Pimple DI container and an overhaul of pretty much everything else! In this post, I'm going to look at error handling. The default error handler in Slim 3 is SlimHandlersError. It's fairly simple and renders the error quite nicely, setting the HTTP status to 500. I want to log these errors via monolog.

He includes the code to first set up the Monolog logger and inject it into the dependency injection container. Then he creates a custom error handler that extends the Slim handler but overrides the __invoke method to log the message in addition to displaying it. Finally he registers the error handler into the DI container as the "errorHandler" instance so Pimple correctly knows how to throw errors.

0 comments voice your opinion now!
log error slim framework monolog custom errorhandler tutorial

Link: http://akrabat.com/logging-errors-in-slim-3/

Sameer Borate:
Create a quick REST API using Slim framework
March 16, 2015 @ 10:16:40

Sameer Borate has a quick tutorial posted showing how to create a basic REST API with Slim, the popular microframework for PHP.

During a recent client project, I frequently needed to access a remote database table and update the same for certain fields. This was accomplished using phpMyAdmin on the server. However, it was getting tedious and was prone to accidental updates and deletes. [...] This is all a tedious process and prone to errors. One solution was to create a quick REST api wrapper around the remote database, using which developers could update the database table without any risk of corrupting the data and also with the added benefit of updating the table programmatically.

He uses an example of working with student data (SQL for the table included) and helps you get Slim installed and working with an Apache install. He covers the overall structure of the API he's creating and the code to help make it happen. Obviously he doesn't share the entire codebase - that would be too large. He does show examples of GET and POST requests for the student data to give you something to work from. He finishes the post with a few simple cURL calls to make requests to the API and the responses.

0 comments voice your opinion now!
rest api tutorial slim microframework example student

Link: http://www.codediesel.com/php/create-a-quick-rest-api-using-slim-framework/

Rob Allen:
Routing to a controller with Slim
February 18, 2015 @ 10:19:08

Rob Allen has a new post today sharing an extension for Slim he's written to make working with controllers easier.

In a couple of projects that I've written using Slim Framework, I've found it beneficial to organise my code into controllers with injected dependencies; probably because that's how I'm used to working with ZF2. To make this easier, I've written an extension to the main Slim class and packaged it into rka-slim-controller which will dynamically instantiate controllers for you for each route.

His library makes it easy to define controller "paths" instead of the typical closures Slim requires to direct the request to a controller file. He gives several example routes, the code that the controller needs and shows how you can inject objects into the constructor of the controller (dependency injection).

0 comments voice your opinion now!
slimframework slim library route controller dependency injection

Link: http://akrabat.com/slim-framework/routing-to-a-controller-with-slim-framework/

Hari KT:
Aura Input Form Inside Slim Framework
September 08, 2014 @ 10:55:13

Hari KT has a new post to his site today showing how you can integrate the Aura PHP components into a Slim framework application for input handling, like from a form. Aura PHP is a set of decoupled components for things like CLI handling, dependency injection and SQL requests (among others).

Rob Allen wrote about Integrating ZF2 forms into Slim. I did write how you can use Aura.Input and Aura.Html to create standalone form for PHP. This time I felt I should write about integrating aura input inside Slim.

He includes the Composer configuration to install the HTML and Input components as well as an up-to-date version of the Slim framework. Code showing how to create the form class (a "Contact form") is included, showing both the creation of the elements and the filtering/validation checks put on each. He shows how the Slim routes would handle the request as well as how the view processes the request and displays the form via a helper. You can get the full working code in this repository over on GitHub.

0 comments voice your opinion now!
auraphp framework slim form input html tutorial

Link: http://harikt.com/blog/2014/09/02/aura-input-form-inside-slim-framework/

Rob Allen:
Integrating ZF2 forms into Slim
August 26, 2014 @ 09:40:47

Rob Allen has a helpful post if you've ever wanted to take advantage of the simplicity of the Slim framework and the power of the Zend Framework 2 forms. In this latest post he walks you through the process of setting it all up and using the ZF2 elements outside of the main framework.

Let's say that you want to use Zend Framework 2′s Form component outside of ZF2 itself. In this case, a Slim application. It turns out that Composer makes this quite easy, though there's quite a lot of code involved, so this is a long article. Start with a really simple Slim Application...

His simple Slim application - just one route - handles both the GET and POST actions and uses several ZF2 components besides just the Form (dependencies mostly). He shows you the updates and additions you'll need to make to the service manager configuration and how to set up some custom validation and the form object in the controller. His example form only has two elements, an email field and a submit button and validation is done on the email address when it's submitted. Finally he includes the View object, extended from Slim's that combines some of the ZF2 and Slim handling to correctly render the form.

0 comments voice your opinion now!
form integration slim zendframework2 tutorial validation

Link: http://akrabat.com/zend-framework-2/integrating-zf2-forms-into-slim/

PHP Town Hall:
Episode 27 Josh Lockhart and Jeremy Mikola
June 30, 2014 @ 09:30:35

The PHP Town Hall podcast is back with their latest episode, number 27, featuring two special guests: Jeremy Mikola and Josh Lockhart.

This episode is a long one, but we are back to improved audio and the video is not just one dude eating pizza for an hour. Josh Lockhart of PHP The Right Way and Slim fame, and Jeremy Mikola who is well known for banging on about clouds and playing magic the gathering. Oh, he also works for MongoDB.

The episode's discussion includes a wide range of topics (and plenty of rambling) about things like plans for Slim 3, Silex vs Slim, PHP The Right Way, Illuminate/Pagination and difficulties around pull requests. You can listen to this latest episode either through the in-page player, by downloading the mp3 or you can watch the video of the live Google Hangout recording.

0 comments voice your opinion now!
phptownhall ep27 jeremymikola joshlockhart slim phptherightway illuminate pullrequest

Link: http://phptownhall.com//blog/2014/06/29/episode-27-foo/

7PHP.com:
A Comprehensive Interview About Slim The Micro PHP Framework
June 24, 2014 @ 10:42:35

On the 7PHP.com site today Khayrattee Wassem has posted the latest in his PHP community interview series. This time it's with Josh Lockhart, creator of the Slim framework, talking about his experiences as a developer and in working on the open source project. This time the focus is more on the framework than Josh himself, though.

Last time, I've introduced the Captain America of The PHP Ecosystem to you, aka Josh Lockhart, via a 7PHP 'PHP Interview series to help drive thy PHP aspirations'. This time we go a little bit further with Josh to find out 'as much as we can' about his little masterpiece, I named Slim Framework - the PHP micro framework. Let's get started..

Josh answers questions about:

  • How the framework got started and what was the motivation behind it
  • What need the project tries to solve
  • Why someone might choose Slim over other frameworks
  • How many developers are involved in the project
  • What's coming in Slim v3

There's lots more too, so be sure to check out the full post for the answers to these and other interesting (and enlightening) questions.

0 comments voice your opinion now!
7php community interview joshlockhart slim framework

Link: http://7php.com/slim-php-framework-interview/

7PHP.com:
Josh Lockhart - Find Good Online Resources And Communities & Use Them To Your Advantage
April 28, 2014 @ 09:17:41

7PHP.com has posted their latest community interview, this time with Josh Lockhart, an author behind the PHP The Right Way project and the Slim microframework. They talk some about his history with PHP, some thoughts on the current state of the language and resources/tools he recommends.

Someone finally took the responsibility to make things go in The Right Direction. And this man, this brave man, this 'super-hero' is here to make a change happen - he is named Mr Josh Lockhart. He is The Captain America of The PHP Community! Josh came forward with a convincing righful movement (if I can allow myself to tag it as such) to help PHP-ers get a sense of good direction when it comes to 'dealing with/and taming' PHP as a tool to make good software. This initiative is named as PHP The Right Way!

Josh answers other questions about his preference in environments, what he sees as the good and bad of PHP and his overall feel of the PHP community and where he feels e fits.

0 comments voice your opinion now!
community interview 7php joshlockhart phptherightway slim

Link: http://7php.com/php-interview-josh-lockhart/


Community Events

Don't see your event here?
Let us know!


opinion laravel application series community php7 configure podcast performance example conference symfony2 library composer interview framework api release voicesoftheelephpant introduction

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework