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

SitePoint PHP Blog:
Practical OOP Building a Quiz App - Bootstrapping
November 14, 2014 @ 13:44:09

The SitePoint PHP blog has kicked off a new series of posts today with the first tutorial about building an application with OOP and the Slim framework. In this starting article they focus in on bootstrapping the application and introducing some of the basics behind MVC and OOP.

At a certain point of my development as a PHP programmer, I was building MVC applications by-the-book, without understanding the ins-and-outs. I did what I was told: fat model, thin controller. Don't put logic in your views. What I didn't understand was how to create a cohesive application structure that allowed me to express my business ideas as maintainable code, nor did I understand how to really separate my concerns into tight layers without leaking low-level logic into higher layers. I'd heard about SOLID principles, but applying them to a web app was a mystery. In this series, we'll build a quiz application using these concepts. We'll separate the application into layers, allowing us to substitute components: for example, it'll be a breeze to switch from MongoDB to MySQL, or from a web interface to a command-line interface.

They start off with a bit about why "MVC is not enough" and how they'll be applying domain modeling as a part of the application. There's also a brief mention of the concept of a service layer and how it will fit into the overall structure. Then it's on to the code: getting Slim installed (via Composer) and starting in on the interface/service classes for the Quiz. They walk you through entity creation for the Quiz and Question instances and a mapper to tie them together.

0 comments voice your opinion now!
practical oop tutorial series part1 bootstrap slimframework solid mvc

Link: http://www.sitepoint.com/practical-oop-building-quiz-app-bootstrapping/

Rob Allen:
Using ZF2 Forms with Twig
September 23, 2014 @ 09:28:53

Rob Allen has a new post today showing how to integrate Zend Framework 2 forms into a Slim framework based application. He started the topic in a previous post and continues, this time using the Twig templating framework to handle the rendering.

The ZF2 view helpers, formRow and formElement now look like Twig functions, however we don't want to have to rewrite all our ZF2 view helpers into Twig. Fortunately, Twig supports the concept of a undefined function callback is called whenever Twig encounters a function that it doesn't know how to call. We can use this to proxy through to the ZendView system and get it to render the ZF2 view helpers.

He shows how to use this callback functionality and a custom view layer with the Slim-Views component to render the output. He includes a simple Slim example, setting up the custom View class as a parser extension and how to register the callback to invoke Twig.

0 comments voice your opinion now!
zendframework twig render slimframework integration tutorial view

Link: http://akrabat.com/zend-framework-2/using-zf2-forms-with-twig/

SitePoint PHP Blog:
Best Practices REST API from Scratch - Introduction
July 22, 2014 @ 09:39:12

The SitePoint PHP blog has posted the second part of their series looking at building up a REST API "from scratch". In this latest post Vita Tardia introduces some of the basic topics and the best practices that are around their use.

The current internet ecosystem has literally been invaded by APIs, and for good reasons. By using third party APIs in your products or services, you have access to a ton of useful features - such as authentication or storage services - that can benefit both you and your users. By exposing your own API, your application becomes "part of the mix" and will be used in ways you've never thought before… if you do it the right way, obviously. In this two part series I'll show you how to create a RESTful API layer for your PHP applications, using a collection of real world best practices.

He talks about how a REST API is a "user interface for developers" and the actions the different verbs could take on the same endpoints (PUT, POST, GET, etc). He uses the Slim framework in his examples and helps you get an instance all set up and working. He includes a bit about getting SSL/HTTPS up and running for all requests to the site too. From there he gets into the bootstrapping of the application and the first version of controller handling. He also includes code examples touching on JSON handling, authentication and good error handling.

0 comments voice your opinion now!
tutorial rest api introduction slimframework bestpractices

Link: http://www.sitepoint.com/best-practices-rest-api-scratch-introduction/

/Dev/Hell Podcast:
Episode 43 Erotic Art the Right Way
April 16, 2014 @ 09:15:47

In the latest episode of the /Dev/Hell podcast (Episode #34, "Erotic Art the Right Way") hosts Ed Finkler and Chris Hartjes talk with Josh Lockhart of Slim framework fame.

Our latest episode features someone who we're been trying to get on for a while: Josh Lockhart, the developer of the Slim Framework for PHP and the founder of the PHP The Right Way project. We also have a new sponsor in Nude New Relic!

Topics they discuss include things like Slim, Sinatra, Flask and Guzzle. You can listen to this latest episode either by downloading the mp3 or using the in-page player. You can also subscribe to their feed to get this and other great shows.

0 comments voice your opinion now!
devhell podcast ep43 joshlockhart slimframework phptherightway

Link: http://devhell.info/post/2014-04-13/erotic-art-the-right-way/


Community Events





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


release community package interview library framework series introduction version voicesoftheelephpant tool language mvc security symfony opinion laravel composer podcast update

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