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

SitePoint PHP Blog:
Building a Basic Video Search App with Vimeo’s API and Slim
Nov 24, 2015 @ 12:02:15

The SitePoint PHP blog has a new tutorial posted showing you how to integrate the Vimeo API with Slim to create a simple web application allowing you to search for videos matching a simple query string.

In this tutorial, you’ll get to know the basics of the Vimeo API. With it, you can fetch information on a specific user or get information on the videos uploaded by the user. If the video is private, you can only get it from the API if the user has given permission to your app.

They start with helping you create a new application on the Vimeo developer site and introduce you to the API playground for trying out various API queries and fetching the results. Following this the tutorial starts in on the application itself, helping you get a Slim application up and running with Twig templating and the Vimeo API library. They bootstrap the application with your Vimeo application credentials and how to log into the API via access tokens. The flow then allows the user to connect their Vimeo account to your Slim application. With this connection in place the user can then view their profile information and execute a search on the "videos" endpoint with a simple query string.

tagged: tutorial api vimeo video slim framework search results apiplayground application

Link: http://www.sitepoint.com/building-a-basic-video-search-app-with-vimeos-api-and-slim/

Programming With Yii2: Using the Advanced Application Template
Nov 24, 2015 @ 10:10:47

NetTuts.com has continued their series around programming with the Yii2 framework in this latest tutorial looking at the use of the Advanced Application Template, an enhanced boilerplate system that provides a bit more built-in functionality than the default application setup.

In this Programming With Yii2 series, I'm guiding readers in use of the Yii2 Framework for PHP. As you begin to use Yii for real development, you may want to start your next project with its Advanced Application Template. Among other things, it provides integrated user management features as well as two applications, one for the consumer-facing front end and the other, an administrative back end.

In this tutorial, I'll introduce you to the Yii2 Advanced Template and guide you through the basic setup and usage.

They start with a look at how the Advanced Template is different from the default one (a checklist) and how to set up a new project using it. They show how to configure the database connection and execute the required migration to build out the user table. They also walk you through the Apache setup for local development and what the resulting "Congratulations" page should look like. The remainder of the post explores the user management section, showing how to configure email delivery, signup, login and password reset requests.

tagged: yii2 framework series advanced application template user management tutorial

Link: http://code.tutsplus.com/tutorials/programming-with-yii2-using-the-advanced-application-template--cms-24994

Sound of Symfony Podcast:
Episode 9 - The past and future of Symfony
Nov 23, 2015 @ 11:19:01

The Sound of Symfony podcast is back today with their latest episodes and some special changes - Episode #9: The past and future of Symfony.

Sound of Symfony is back from its unplanned hiatus and launching a new format. We're also switching things up, and add two new co-hosts, Ryan Weaver and Jared Farrish.

This episode's topic is "How has Symfony kept up".

Topics mentioned in this episode include the NelmioApiDocBundle, the HATEOAS library from William Durand and a pull request for dynamic environment variables to Symfony. You can listen to this latest episode either through the in-page audio player or by downloading the mp3 of the episode directly. Be sure to subscribe to their feed and follow them on Twitter for the latest updates as new episodes are released.

tagged: soundofsymfony podcast ep9 past future framework ryanweaver jaredfarrish

Link: http://www.soundofsymfony.com/episode/episode-9

Rob Allen:
Writing PSR-7 middleware
Nov 05, 2015 @ 13:48:58

In this new post to his site Rob Allen talks about PSR-7 compatible middle ware and shows examples of writing it to work with frameworks that support the PSR-7 structure. His examples revolve around Slim 3 but could be used in other supporting frameworks just as easily.

Within Slim 3's Request object, there's a method called getIp() which is determines the client's IP address. However it's rather simplistic and potentially risky as it checks the X-Forwarded-For header with no ability to ignore this header or whitelist whether we trust the final proxy in the chain. Determining the client's IP address is an ideal use-case for middleware as we can inspect the headers in the request and then set an attribute so that middleware further down the chain can use it.

With this goal in mind, he shows how to create the middleware that uses the __invoke method to execute the required logic and call the next middleware in the chain. In his example he makes use of a pseudo-method determineClientIpAddress that does the work of detecting the IP address and then sets the value as a part of the request object (as an attribute). He also shows how to configure the middleware to select an attribute name and how to attach the middleware to a few different framework types.

tagged: pst7 middleware slim3 framework ipaddress tutorial

Link: http://akrabat.com/writing-psr-7-middleware/

Joshua Sampia:
CORS Slim PHP Setup
Nov 05, 2015 @ 10:38:47

In this post to his site Joshua Sampia shows how to set up and configure CORS in your Slim-based application. CORS or Cross-Origin Resource Sharing, lets you further lock down what sources can access your application and some requirements around the ones that can.

Ok, another PHP post but this time it’s about setting up some middleware for a slim PHP application.

Let me set this up. We are building a simple REST API for use with a basic phone native app (both Android and iOS). Me being new to this, I wasn’t sure if the native app domain call is considered cross browser or not, plus there are some outside companies we are working with who MAY access the API as well. [...] I setup some middleware by extending the Slim Middleware class and adding them via the app.

He talks about the steps he had to take in the middleware to set up an AccessControlOrigin middleware (and two others requiring HTTPS and HTTP Basic Auth). He includes the simple code to send the required HTTP headers to support CORS on the response object and the update to his Javascript to include credentials with every request.

tagged: cors slim framework security middleware https httpbasic authentication crossorigin

Link: http://joshuasampia.com/2015/11/05/cors-slim-php-setup/

SitePoint PHP Blog:
How to Build a NASA Photo Gallery with Zend Expressive
Nov 03, 2015 @ 09:52:06

The SitePoint PHP blog has a new tutorial from author Andrew Carter showing you how to create a NASA photo gallery application with the latest framework offering from Zend, Zend Expressive.

In this article, we are going to use Zend Expressive to build a photo gallery using the NASA Astronomy Picture of the Day API. The end result will be the AstroSplash website which was created for the purpose of this article. [...] Zend Expressive is an exciting new micro-framework for building PSR-7 middleware applications. [...] Middleware is a term that will be used a lot in this article. A good definition of middleware is given by the Zend Expressive documentation.

They walk you through the basics of the application and how to set up an account and application over on the NASA API. They help you create the initial project, what the output should look like and commands to remove some extra code. They include the configuration of the container, set up the route middleware, work with the templating for the app and connecting it with Doctrine for database storage. Finally they integrate the NASA API using this library and pull down the latest images from the service.

tagged: zendexpressive tutorial nasa image application api framework middleware

Link: http://www.sitepoint.com/build-nasa-photo-gallery-zend-expressive/

Laravel News:
Laravel 5.2 - A Look at what’s coming
Nov 02, 2015 @ 11:06:05

The Laravel News site has posted a look ahead at Laravel 5.2, the next minor version release of the popular framework.

ravel 5.2 development is underway and so far a few nice additions have been announced. Let’s take a look at everything we know is coming to the release.

Among the things mentioned are improvements/features like:

  • Implicit model binding
  • Form Array Validation
  • Collections Wildcards
  • Database Session Driver updates

This version isn't released yet (as of the time of this post) but it's coming soon. Keep an eye on the main Laravel site for more information.

tagged: laravel minor version update enhancement feature framework

Link: https://laravel-news.com/2015/11/laravel-5-2-a-look-at-whats-coming/

Laravel News:
Laravel Intermediate Tutorial
Oct 29, 2015 @ 10:49:56

The Laravel manual was recently updated with a quickstart to help beginners to the framework learn the basic steps to creating a simple Laravel application. According to the Laravel News site they've also added an intermediate tutorial that gets a bit more in-depth with the framework and expands on the same "task list" example application.

This intermediate tutorial covers Eloquent relationships, Authentication, Dependency Injection, Route Model Binding, Authorization, and more. Both of these Laravel tutorials are fantastic resources for getting up and running with the framework.

You can find this tutorial in the Laravel manual and, if it seems like a bit much and you want a more basic level, you can check out the quickstart instead and get up and running quickly.

tagged: laravel intermediate tutorial tasklist introduction framework

Link: https://laravel-news.com/2015/10/laravel-intermediate-tutorial/

Laravel News:
Laravel Quick Start – Learn to build a task list
Oct 28, 2015 @ 09:46:44

On the Laravel News site they mention a new quickstart guide that's included in the official Laravel manual now, walking you through the creation of a simple "to do" list application and introducing you to the framework.

The Laravel documentation now includes a dedicated quick start section to guide you through creating a basic task list. For those new to the framework, this is an excellent guide to show you the basics but even the experienced can pick up new tricks. [...] To go along with the tutorial is a Github repo where you can view all the source and easily check it out to play around yourself.

The quickstart steps you through the entire process of creating the application, from a Composer create-project out to the task CRUD (create, read, update, delete) functionality. It shows the use of the Eloquent ORM, routing functionality, views, Blade templates and more. If you're new to the framework and want to check out what it's all about this is a great place to get started.

tagged: laravel framework qickstart task list todo introduction

Link: https://laravel-news.com/2015/10/laravel-quick-start-learn-to-build-a-task-list/

Zend Developer Zone:
Announcing Expressive 1.0.0RC1!
Oct 22, 2015 @ 09:27:14

On the Zend Developer Zone Matthew Weier O'Phinney has posted an announcement about the release of the first Release Candidate for Expressive, version 1.0.0RC1. It builds on top of the zend-stratigility component of the Zend Framework.

Today, we are pleased to announce the immediate availability of the first release candidate of Expressive, a [PSR-7](http://www.php-fig.org/psr/psr-7/) [middleware](https://github.com/zendframework/zend-stratigility/blob/master/doc/book/middleware.md) microframework.

Expressive allows you to write PSR-7 middleware applications for the web. PSR-7 is a standard defining HTTP message interfaces; these are the incoming request and outgoing response for your application. By using PSR-7, we ensure that your applications will work in other PSR-7 contexts.

The post gives a brief introduction to the framework and lists some of its main features including:

  • customizable routing choice (select from several packages, not just forced into one)
  • implements the ContainerInterface for dependency injection handling
  • allows for the integration of several types of templating tools (Plates, Twig, etc)
  • customizable error handling (defaults to a template-based version)

He then walks you through getting started with the framework and creating a simple project. The setup prompts you and walks you through several choices of other packages to install (a router, a template library, etc) and hooks them all together. Once the installation is complete, all it takes is a simple web server start (PHP's own built-in works fine) and you'll have a fully functional application to work with. You can find out more information about the framework through the quickstart and full documentation.

tagged: expressive framework middleware psr7 releasecandidate rc1 announcement

Link: http://devzone.zend.com/6814/announcing-expressive-1-0-0rc1/