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

Anthony Ferrara:
A Beginner's Guide To MVC For The Web
November 24, 2014 @ 10:42:41

Anthony Ferrara has posted what he calls a beginners guide to MVC for the web, a tutorial that introduces to you the basic concepts behind the Model-View-Controller design pattern and how it should fit in with the SOLID design principles.

There are a bunch of guides out there that claim to be a guide to MVC. It's almost like writing your own framework in that it's "one of those things" that everyone does. I realized that I never wrote my "beginners guide to MVC". So I've decided to do exactly that. Here's my "beginners guide to MVC for the web".

He starts with his first lesson, his most important one really - you don't need "MVC" (the concept, not the pattern...he notes them differently). He then gets into what the MVC pattern actually is and describes each piece and how they fit together. Following that, he talks about "MVC" as a concept and how it's different from MVC, the design pattern (hint: the pattern describes one implementation of the MVC ideals). He talks about the role of state in the MVC structure and how the implementation of the MVC idea is slightly different in the various "MVC frameworks" out there.

There is a very useful lesson that MVC brings: Separation Of Concerns. Meaning that you should separate different responsibilities into different sections of your application. Separation of Concerns is a necessary step in dealing with Abstraction. Instead of latching on to MVC, latch on to abstraction. Latch on to separation of concerns. Latch on to architecture. There are far better ways to architect and abstract user interaction for server-based applications than MVC.
0 comments voice your opinion now!
beginner guide mvc modelviewcontroller designpattern concept solid abstraction

Link: http://blog.ircmaxell.com/2014/11/a-beginners-guide-to-mvc-for-web.html

SitePoint PHP Blog:
PHP Streaming and Output Buffering Explained
September 04, 2014 @ 10:17:44

The SitePoint PHP blog has a new performance-related post to the site today from Imran Latif. This new post looks at effective use of output buffering and streaming and explains how it works and some examples of its use.

As a PHP developer, I was wondering whether we can have something similar [to Streaming in Rails] in our favorite language? The answer is yes - we can easily have streaming in PHP applications with little effort, but in order to get this right we have to become familiar with some underlying concepts. In this article, we will see what streaming is, what output_buffering is and how to get our desired result under different webservers (Apache, Nginx) and PHP configurations (CGI, mod_php, FastCGI).

He starts off with a comparison of the two different methods, streaming and output buffering, and how they behave in the output of content. He then gets into some simple examples with PHP with various methods: a simple delay, chunking up output and finally using the actual output buffering handling PHP offers. He also includes an example of streaming content over an Ajax request with a simple test using the sleep function.

0 comments voice your opinion now!
streaming output buffering tutorial introduction beginner ajax

Link: http://www.sitepoint.com/php-streaming-output-buffering-explained/

Dawn Casey:
Things Developers Say
June 05, 2014 @ 09:13:45

In this new post from Dawn Casey (wife of the infamous Keith Casey) she talks about some of her "growing pains" around becoming a new developer and the learning process. She's come up against some interesting problems in the course of her learning, both good and frustrating.

In the course of my learning development (seven months at this point) I've heard quite a few things from other veteran developers, all of whom were trying to be helpful. Or I'd ask a question and get one of these things in response because it makes sense to *them*…they don't realize I have no point of reference. [...] I'm frustrated because they can't explain whatever it is I don't understand..mostly because I don't understand exactly what it is I'm not understanding.

Her frustration comes not only from not being able to ask the right questions, but also from being a "blind deaf alien" thrown into the world of development. She point out an issue common to those trying to get into programming: the wealth of information one needs to know before getting started. She also mentions another common problem, particularly for new developers (or those looking to improve one certain skill): the sometimes unhelpful nature of other, more experienced developers. While some are happy to help and guide you through the learning process, there's others that will just toss you a tutorial link and call it a day.

Here's the gist of what I'm saying: There is so much back-knowledge needed to be a web developer today that many are derailed for months trying to learn everything they need to know before they can learn anything at all. PLEASE REMEMBER THIS!!
0 comments voice your opinion now!
developer beginner experience opinion help learning

Link: http://sdawncasey.wordpress.com/2014/06/04/things-developers-say/

SitePoint PHP Blog:
How to Use the JsonSerializable Interface
May 05, 2014 @ 11:50:28

Matrin Hardy has a new tutorial posted to the SitePoint PHP blog today showing you how to use the JsonSerializable interface to work with objects and converting them to JSON.

Over the past few years JSON has taken over as the king of data interchange formats. Before JSON, XML ruled the roost. It was great at modeling complex data but it is difficult to parse and is very verbose. [...] I think we could all agree that writing less code that in turn requires less maintenance and introduces less bugs is a goal we would all like to achieve. In this post, I'd like to introduce you to a little known interface that was introduced in PHP 5.4.0 called JsonSerializable.

He splits the rest of the post out into three different parts: the "ugly" method of converting a sample Customer object into a JSON string (through an array), the "bad" method using a "toJson" method and finally the "good", implementing a class that implements the JsonSerializable interface for easy JSON-ification.

0 comments voice your opinion now!
jsonserializable interface tutorial introduction beginner

Link: http://www.sitepoint.com/use-jsonserializable-interface/

SitePoint PHP Blog:
Getting Started with PHP Extension Development via PHP-CPP
March 27, 2014 @ 12:15:08

On the SitePoint PHP blog today there's a new tutorial from Taylor Ren showing you how to get started with PHP-CPP for creating PHP extensions. PHP-CPP is a C++ library that makes it simpler (and faster) to create PHP-specific extensions.

In your dealings with PHP, you may come to consider writing a PHP extension yourself. [...] When it comes to choosing a tool to build PHP extensions, we see two different approaches: use more pro-PHP semantics, like Zephir or use more pro-C/C++ semantics, like PHP-CPP, which will be addressed in this article. For me, the main drive to select the second approach is simple: I started my programming hobby with C/C++, so I still feel more comfortable writing those lower level modules in C/C++. PHP-CPP's official site gives a few other reasons to do so.

He walks you through the installation of the library (for now, just a git clone) and getting the needed environment set up to be able to compile and test out the extension. He helps you set up the "skeleton" files for the extension, including some sample content. He includes code for a typical "Hello World" example extension as well as its use in a sample PHP script.

0 comments voice your opinion now!
tutorial extension introduction phpcpp library beginner

Link: http://www.sitepoint.com/getting-started-php-extension-development-via-php-cpp

CodeHeaps.com:
Creating a Blog Using Laravel 4 (Series)
February 18, 2014 @ 10:53:20

The CodeHeaps.com tutorial site, they've posted the latest in their tutorial series creating a blog with the popular Laravel framework. In the first part they looked at models and database seeing, in part two they focused on controllers and in this latest part they focus on routing.

In this article we will create a simple blog using Laravel 4. Our blog application will have the following features: display posts with read more links on home page, search posts on blog, display a single post with comments and allow users to post comments. Administrator will be able to perform CRUD operations on posts and comments [and ] will be able to moderate comments.

In the three parts so far they show some simple migrations to create the "posts" and "comments" table and some basic (lorem ipsum) content. They create a basic "blog" controller and login functionality to identify the current user. Finally, they create the routing to hook it all together including some "before" hooks and authentication protection on the administrative areas.

0 comments voice your opinion now!
series tutorial laravel framework blog beginner model controller routing

Link: http://www.codeheaps.com/php-programming/creating-a-blog-using-laravel-4-part-3-routing/

Matt Frost:
Getting Talks Selected
January 27, 2014 @ 09:04:23

If you're considering getting into the world of speaking at an upcoming PHP conference, Matt Frost has some advice for you to help you get started. It can be intimidating, so learn from some of his own experiences as a relatively new speaker in the community.

It's a very busy conference season in and around the PHP Community. [...] These conferences are such a blessing to those who are able to attend, the speakers know their stuff and are very open to sharing and talking outside of their sessions. But you're a smart cookie too! You've got ideas and thoughts and knowledge that other people would like to have, so how do you get in on this? I'm going to tell you how I got into it, your mileage may vary, but hopefully it helps.

He points out that submitting a talk and getting accepted is "a lot like the lotto" sometimes, that you can't win unless you buy a ticket (submit that talk). He looks at a few of the other common questions from beginning speakers - what do I talk about, how do I write an abstract and common first time speaking concerns.

There's no magical elixir that will land you speaking gigs at cool conferences. Everyone that speaks, from the seasoned pro to the up and comer, has worked extremely hard to not only put the talks together; but acquire all the knowledge necessary to give the talk in the first place
0 comments voice your opinion now!
talk session technical conference advice beginner speaker

Link: http://shortwhitebaldguy.com/blog/2014/01/getting-talks-selected

Paul Jones:
Framework Tradeoffs For Beginners Product Creation vs Program Maintenance
January 22, 2014 @ 11:53:42

Paul Jones has shared some of his thoughts about framework tradeoffs in his latest post. In it he compares two perspectives about framework use for beginners - either the "get something out there" product approach or focusing on the the long term maintenance of the product.

Phil Sturgeon at his blog, writing about product creators who neither know nor care much about programming as a discipline. [...] Phil's post focuses on the joyful, proud moments of creation that lead to business success, whether in terms of venture funding or continued sales. In this essay, I want to focus on what happens after that, when that initial creation passes into other hands to be maintained.

Paul talks about how frameworks can allow developers to work "beyond their level" and be more productive than they could be otherwise. He points out that this can create a beginner-level codebase that works "just enough" and then is usually passed off to more experienced developers to update, change and flat out fix issues.

From a financial standpoint, and perhaps even from an economic standpoint, it's easy to see enabling-via-framework as a positive. Indeed, the product creator may justify his failures of good programming practice by substituting the product popularity and continued rounds of funding as a marker of success. [...] But from a programming practices standpoint, enabling-by-framework too often leads to pain and frustration on the part of the maintenance programmers, who are now saddled with the baggage of an amateur.
0 comments voice your opinion now!
framework tradeoff beginner product creation maintenance

Link: http://paul-m-jones.com/archives/5890

Reddit.com:
I do not get how to use a php framework.
January 16, 2014 @ 10:37:34

If you're new to the world of PHP frameworks and are having trouble wrapping your head around using one, you should check out this discussion over on Reddit. The poster asks some advice on getting started with frameworks and wether they need one or not.

Hey. I've been learning PHP now for some weeks on a hobby level and I do think it's alot of fun! But, I hear, everywhere people say "Dont reinvent the wheel" and how good frameworks are, but there is some stuff stopping me. [...] And why I just do not keep continue to do my own buisness is becasuse, I hear all this talk about how secure frameworks are, and Im super scared of writing a php website and messing something up. SQL Injections etc etc. So... Do I REALLY need to use a framework, It seem to just complicate things to a whole other level than my current PHP skill.

Responses on the post include a good range of thoughts including:

  • "You could instead use a CMS which have elements of a framework built in"
  • "I think that Silex is just right for you, and should be familiar enough with your current practice while teaching you the new things you need to know as you go along."
  • "Absolutely use a framework, but don't lose that drive to learn how code works."
  • "Any framework of repute is making heavy use of design patterns. Having a rudimentary understanding of these will help frameworks make much more sense to you."
  • "A framework exists to ease your development [...] A lot of sites use frameworks, but there's nothing stopping you from doing your own thing."
  • "If you get confused by larger frameworks and like to have more control over every aspect of your code, it sounds like a micro-framework might be the right choice for you."
0 comments voice your opinion now!
use framework opinion beginner introduction

Link: http://www.reddit.com/r/PHP/comments/1va2dn/i_do_not_get_how_to_use_a_php_framework/

David Makin:
Creating a simple REST application with Silex
December 27, 2013 @ 10:36:48

David Makin has put together a new post to his site showing you how to make a simple REST web service with Silex, the PHP microframework from the Symfony project.

So you have come to the conclusion that, rather than having the code to update customer details and that little fix to convert the date from GMT to UTC should happen in once place rather than being copied into several pieces of code, a REST service is the answer. Perhaps you just think you should know how to create a REST service. Either way this post is for you. In this post we will start off with a blank directory and go through installing Silex and getting it to serve a couple of simple routes.

He helps you get Silex installed via Composer and gets you started with a simple root and "stock code" route. He uses these to explain a bit about the framework's route handling and includes URLs to call that will execute them.

0 comments voice your opinion now!
silex microframework introduction beginner tutorial

Link: http://sleep-er.co.uk/blog/2013/Creating-a-simple-REST-application-with-Silex/


Community Events





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


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

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