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

Medium.com:
Laravel and Vue JS: Advanced Frontend Webapp Architecture
Jul 17, 2015 @ 08:46:10

On Medium.com Russ Weas has posted a tutorial showing you how to get Laravel and Vue.js working together to create a well-structured, two-way application.

Do you use Laravel PHP and Vue JS? Do you wish there was a better way to structure your applications you build? This tutorial is just for you! In it, we set up simple two-way communication between the different components of your front-end app.

While he does provide the end result as a GitHub repository, he still walks through the full integration process to fill in the gaps. He starts with a brief introduction to a Vue.js application structure (based off of this video) and what parts need to be in play to follow along. From there he gets into the two-way communication aspect, showing how to create the bridge between the application, its views and components. He talks about some of the "missing pieces" of the current structure including an update to pass in a dependency injection "container" on the Vue side similar to how Laravel's IOC container works.

The remainder of the post is split into three parts, each with an update to the view layer (on the client side) to work with the new IOC structure:

  • using this.app in each view
  • setting data for a particular view from other views or the main app
  • calling view functions

He concludes the post with the full code for the two files they've been working with, showing everything working together: the HTML template (Laravel view) and the "app.js" Javascript for the Vue.js code.

tagged: laravel tutorial architecture vuejs frontend framework

Link: https://medium.com/laravel-news/advanced-front-end-setup-with-vue-js-laravel-e9fbd7e89fe2

php[architect]:
April 2015 Issue Released - Front-End Polish
Apr 14, 2015 @ 11:05:47

php[architect] magazine has officially released their April 2015 edition - "Front-End Polish".

It’s safe to say that a majority of PHP programmers prefer working on “back end” code. Many interesting problems live in that domain. But we can’t forget that the front end—usually HTML, CSS, and JavaScript—is where users will interact with our applications. The joy or frustration they experience trying to get a task done affects their perception of how good (or poor) your solution is for a long time. Even if you don’t want to be a front end designer or developer, you must be familiar with User Experience and the technologies used in the user interface (UI) to understand how people will use it, to help reduce sources of frustration, and to prevent errors.

Articles in this month's issue include:

  • Object Oriented JavaScript (Part the Second)
  • The Browser Capabilities Project in 2014
  • UX Without the Process
  • PHP Conference Newbies 101

Head over to the php[architect] website to pick up a (print or digital) copy of your own!

tagged: phparchitect magazine april2015 frontend issue release

Link: http://www.phparch.com/magazine/2015-2/april/

Angular Tips:
Working With a Laravel 4 + Angular Application
Oct 28, 2014 @ 09:11:31

On the Angular Tips site today they have a tutorial posted showing you how to combine the power of the Angular JS frontend framework with a Laravel backend. They walk you through the full process of getting an application up and running, including a bit of actually functionality (not just a "Hello World").

So you decided that Laravel is a great choice for a backend and that Angular is going to fit perfectly as the framework of choice for the frontend. Yeah! That is correct and I am starting to like you. How to start? So many question, so little time.

They start by getting everything you'll need installed, both on the Laravel and Angular sides. Then it gets into the actual development of the application, changing up the default Laravel page to include Angular and a little test to be sure it's working correctly. With this working correctly (after a little route updating too) they get to the more real-world application: a listing of TV shows generated from a dataset on the Laravel backend. They include all the code you'll need to create the frontend app and display the results.

tagged: laravel tutorial angularjs application frontend framework

Link: http://angular-tips.com/blog/2014/10/working-with-a-laravel-4-plus-angular-application/

SitePoint PHP Blog:
Dart and PHP: A Legacy Animal Guess Game
Dec 10, 2013 @ 11:54:40

The SitePoint PHP Blog has a new tutorial posted today showing an interesting combination of technologies to create a simple Animal Guesssing Game - using Dart as the frontend and PHP as the backend.

Back when I was learning programming on Apple II using BASIC, there was an Animal Guess Game. This game was a very primitive AI game: the computer tries to ask a few YES/NO questions and receives the answer from the user. Based on the answer, it may ask more Y/N questions until it tries to guess the animal. In this tutorial, we will learn how to re-vitalize this program using PHP as backend and Dart as frontend. Of course, a database will be used to store all the questions and guesses of animals.

He walks you through the database setup (including table definitions) and provides some simple PDO-based code to connect and fetch results. Then comes the Dart frontend. He goes through the installation and configuration and how to make a new Polymer application, also including the markup and Dart code to make the backend connection.

tagged: dart animal guess game backend frontend tutorial

Link: http://www.sitepoint.com/dart-php-legacy-animal-guess-game

Greg Freeman:
Your PHP Framework Choice doesn’t Matter
Aug 22, 2013 @ 11:45:18

In this new post Greg Freeman suggests something contrary to what most PHP developers (and framework supporters) believe - your choice of PHP frameworks doesn't matter...if you're basing it on speed.

I’m talking about the speed of PHP and more specifically, evaluating frameworks and tools based on “speed”. If you have been in the PHP developer community for more than a few months, you would have seen at least a few discussions about what the fastest PHP framework is, as if this were one of the first key metrics you should evaluate first when choosing a framework for your team. You may even be contemplating switching from your current framework because you heard of a new framework that is faster. In the rest of this article, I’m going to do my best to show you why this not the best line of thinking and provide alternate and in my opinion better metrics for evaluating tools.

He talks about "frontend" versus "backend" PHP developers and how most PHP devs fit into the first category, not knowing how their applications really execute on the backend. This includes a pretty high-level concept of "speed." For his examples, he sets up a WordPress instance and fills it with some dummy content. He illustrates how, with a bit of tweaking on the "backend" side of things (server, environment, etc) the performance of the application can be greatly varied. He includes the specs for the environment he ran the tests in, some of the things he changed and a summary of the results.

tagged: framework choice speed benchmark frontend backend environment

Link: http://www.gregfreeman.org/2013/your-php-framework-choice-doesnt-matter

php[architect]:
July 2013 Issue - Front End Development
Jul 25, 2013 @ 11:28:57

php[architect] has published their July 2013 edition of the magazine with a focus on "Front End Development".

Front end development is usually the last consideration for web developers, but it’s just as important as the server-side functionality. In some ways, it’s more [immediately] important, because it’s the functionality the end user interfaces with. Unless you have a wunderkind designer that can also code, this is a task for you.

This month’s issue covers technologies, techniques, and concerns that deal with modern front end coding. Frameworks that simplify coding across platforms like jQuery Mobile and Sencha Touch are discussed in “jQuery Mobile: Cross-Platform Sites Made Easy” and “Create an App to Touch the Web”.

Other topics included in this issue are polyfills in HTML5, automated deployment and the second part of a series looking at using Stripe for payments.

tagged: phparchitect frontend development release july2013

Link: http://www.phparch.com/2013/07/phparchitect-magazine-july-2013-front-end-development

Gonzalo Ayuso:
Working with AngularJS and Silex as Resource provider
Jun 04, 2013 @ 09:57:47

Gonzalo Ayuso has a new post to his site looking at the use of Silex and AngularJS together to make Resources that AngularJS can pull data from.

This days I’m playing with AngularJS. Angular is a great framework when we’re building complex front-end applications with JavaScript. And the best part is that it’s very simple to understand (and I like simple things indeed). Today we are going to play with Resources. Resources are great when we need to use RestFull resources from the server. In this example we’re going to use Silex in the backend. Let’s start.

He shows how to get the Resource functionality working in AngularJS (including another file) and a sample SQL table definition to hold some author/message information. He includes the HTML for the one page the example needs and the various pieces - the Javascript controller, the Silex routes, the routing configuration and the Resource controller. A screencast and the complete code are also provided.

tagged: silex angularjs resource rest tutorial screencast frontend

Link: http://gonzalo123.com/2013/06/03/working-with-angularjs-and-silex-as-resource-provider

Matt Frost:
Starting with Selenium (and Headless on a VM)
Aug 27, 2012 @ 08:16:55

Matt Frost has posted a two part series of some of his experiences in setting up Selenium to execute it in a VM and run tests on your application.

I was a little scared when it came to setting up Selenium, I figured it was going to be difficult to setup and configure. So I was pleasantly surprised when it really wasn't. So here are a few of the mistakes I made; since I use Vagrant to do all my development I actually grabbed Selenium and started from there. Not a good place to start, although as I found out later; not a total dead end.

He includes the initial setup of things like PHPUnit and the Selenium .jar file as well as a sample test that loads a page and checks the title of the page. His second post shows how to set it up in the VM (using Vagrant, xvfb to capture the output and Firefox to execute the tests).

tagged: selenium frontend testing vm vagrant firefox java xvfb

Link:

PHPClasses.org:
Using DaDaBIK to create a PHP CRUD Database Front-End without coding
May 10, 2012 @ 09:16:23

On the PHPClasses.org blog there's a recent post about using the DaDaBIK project to automatically generate a database CRUD frontend without having to code any of it by hand.

Writing CRUD database front-ends and simple database applications is a very common task that almost all PHP developers need to implement. It is usually a simple job to accomplish, but is also time consuming, boring and error-prone to implement. Software developer’s tend to avoid time wasting and repetitive tasks in favor of more challenging tasks. This lead to the development of applications with the goal to automate front-end development. DaDaBIK is one of the precursors of this kind of applications for automated creation of PHP front-ends. Released initially in the year 2000 by myself, Eugenio Tacchini, the project continues to be actively developed until today.

Included in the post are a few screenshots of the interface and a screencast showing it in use. You can find out more about the project on the DaDaBIK website.

tagged: dadabik project crud database frontend generate code

Link:

Shashikant Jagtap's Blog:
Enjoy 'MinkExtension' for Behat
May 08, 2012 @ 10:55:55

In this new post to his blog Shashikant Jagtap talks about a new extension for Behat (the BDD testing tool) that makes working with Mink even easier - MinkExtension.

'MinkExtension' has been just released which has additional services for Behat. This extension has ‘Mink’ instance for your ‘FeatureContext’ and ‘SubContext’. UI testers would be happy now, as they don’t need to create Mink instance every time in order to use Mink API’s.

He points you to an example application you can use to follow along. He includes the commands needed to install the dependencies via Composer and get this extension working (note: it requires PHP 5.4 for some of the traits stuff. If you don't want to use that, comment out the "TraitedFeatureContext.php" file). Also included are the commands to execute the tests with a Selenium server and a list of a few handy new things this extension enables.

tagged: minkextension mink behat bdd testing frontend selenium

Link: