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:
Building a Simple Blog App with MongoDB and PHP
March 14, 2014 @ 09:19:36

On PHPMaster.com there's a recent tutorial posted showing you the creation of a simple blog application with MongoDB + PHP. It's a basic overview, so it's mostly about creates and reads, but it does help get things working.

If you want to create a blog using MongoDB and PHP, this article will teach you. [...] The reason I chose to build a blog application is because it is a basic CRUD application and it is very suitable for easing into PHP and MongoDB web development. We will build a plain user interface using Bootstrap with simple textboxes and buttons. A MongoDB database will store all the content.

He starts off by introducing MongoDB and some of the basic concepts around databases, collections and documents as they relate to it. He then moves into the installation process, getting and configuring a simple MongoDB instance running on localhost. He helps you get the MongoDB PECL driver installed for PHP and includes a bit of code to test the connection. Finally, he gets into the blog example itself and includes the full code to get it up and running.

0 comments voice your opinion now!
tutorial blog application sample introduction mongodb database

Link: http://www.sitepoint.com/building-simple-blog-app-mongodb-php/

Paul Jones:
Leanpub Sample Files With Symfony and Aura
February 27, 2014 @ 09:51:49

In a recent post to his site Paul Jones shares some work that's been done to help generate books in the Leanpub formatting with an Aura framework-based script.

One of the things that bothers me about some cli/console packages is how the commands you write with them end up being tightly coupled to the "framework" the package provides. [...] Most of the time I don't need a "full console application" - I just need to read some input for the command, run my actual command logic, and send some output from the command. The Leanpub Sampler from Matthias Noback is an example of the kind of thing I usually end up doing in small or one-off projects.

The script makes use of the Aura.Cli component for console interaction then a custom object for the actual work. This completely decouples the CLI handling from the code to produce the resulting document. You can find out more about the Aura framework on the project's main site.

0 comments voice your opinion now!
leanpub sample file symfony aura auracli

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

SitePoint.com:
Best Practice for Code Examples
August 14, 2013 @ 10:29:55

If you've ever thought about including code examples in your (blog/site/etc) posts and were wondering how to least frustrate your site's visitors, check out these suggestions from one of SitePoint's UX authors, James Edwards.

The majority of articles about web development include code examples, and across the web we see great variation in how they're formatted and presented. But a lot of them are not very good - because the code is badly formatted, hard to read, or can't be copied-and-pasted without unwanted junk. So in this article I'd like to take a hard look at code examples, to investigate the common problems they have, and try to establish some best practice for how they should be done.

He talks first about the whole point of including code examples in a post and five basic principles for what they should be like:

  • Code examples should use good semantic markup.
  • Tabs in code should not be converted to spaces.
  • Code should have basic syntax highlighting.
  • Code examples can have horizontal scrolling, but shouldn't have vertical scrolling.
  • Code examples should have line numbers, which are not included in text selection.

There's some examples of code markup included as well as some CSS rules you can drop in to help follow his suggestions.

0 comments voice your opinion now!
bestpractice code sample ux example

Link: http://www.sitepoint.com/best-practice-for-code-examples

NetTuts.com:
Let's TDD a Simple App in PHP
August 07, 2012 @ 10:18:07

On NetTuts.com there's a new tutorial that wants to show you a practical approach to using TDD in your development (test-driven development) through a simple project.

In this tutorial, I will present an end-to-end example of a simple application - made strictly with TDD in PHP. I will walk you through each step, one at a time, while explaining the decisions I made in order to get the task done. The example closely follows the rules of TDD: write tests, write code, refactor.

They start off by defining what TDD is (three core rules) and how the PHPUnit tool makes it easy in PHP. They use NetBeans in their examples, but it can be done similarly in any other ID (or command line). They start with some first tests - checking for word wrapping on short string and empty string handling.

0 comments voice your opinion now!
tdd testdriven development tutorial unittest sample application


Rob Allen's Blog:
Some ZendView examples
March 12, 2012 @ 10:52:48

Following on the heels of the beta 3 release of the Zend Framework 2, Rob Allen has been posting more about its features and what's changed from the version 1 world. In this new post he looks at some examples of how to use the newly refactored ZendView component.

With the release of Beta 3 of Zend Framework, we now have a significantly refactored the ZendView component. One of the changes made is that there is a ViewModel object that is returned from a controller which contains the variables to be used within the view script along with meta information such as the view script to render. [...] However, we can do many more interesting things than this and I've put together a test application with a controller showing some of the things that can be done.

Included in the post includes two snippets of code from the sample project - how to change the layout in the action and creating another view model at the layout level.

0 comments voice your opinion now!
zendframework2 zendview sample application zf2


PHPMaster.com:
Getting Started with PHPUnit
November 15, 2011 @ 08:25:49

On PHPMaster.com today, there's a new tutorial helping you get started with on of the most popular unit testing frameworks for PHP, PHPUnit. In this new article they help you write your first tests, run them and figure out what to do when they fail.

Most people know that testing your websites is a good idea, but after some time testing can become tedious. What if a lot of this testing process could be automated so you don't have to go trough every function manually, time after time, to ensure that it still works after updating your code? This is where unit testing comes in, to automate the testing process.

She starts with a simple, self-contained test - setting and getting a "name" value from a User class. The tests include an example of a setup/tear down and check that the result of the "talk()" method is correct with an assertEquals.

0 comments voice your opinion now!
phpunit unittest introduction sample


Rob Allen's Blog:
Updated tutorial for Zend Framework 2 beta 1
October 19, 2011 @ 08:33:26

Rob Allen has a quick note for fans (or those just discovering) his "Getting Started with Zend Framework" tutorial - he's posted an updated version for ZF2 beta 1.

Getting started with Zend Framework 2 (beta1), creates the same application as my ZF1 tutorial, so it should be very familiar, but this time, it's in the context of Zend Framework 2. As usual, it's a PDF too.

This latest version gives you a gentle introduction to the framework and steps you through the creation of a sample music inventory system. It includes code and explanations of how set up modules, controllers, models and views and how to tie them all together. If you're new to the framework and want to get off and running quickly, I'd highly recommend his tutorial.

0 comments voice your opinion now!
zendframework tutorial zf2 application sample pdf


DZone.com:
Practical Google+ Api
September 21, 2011 @ 08:27:53

On Dzone.com today Giorgio Sironi has a new post looking at a relatively new release on the social networking scene for developers, the Google+ Api, and some details on how you get get started writing apps using the features it offers.

Google+ recently releases to developers the first version of its Api, which focuses on public data about profiles and their activities: status updates, resharings and links. I dived into the Api and wrote a small sample application to get a feel of how easy is to get started, and what can we do with the Api for now. All the code is at the bottom of this post.

He goes through the steps you'll need to get set up - registering an application, getting a library to help make the connection (here's a PHP one) and configuring it with your credentials. You can get "People" and "Activities" information from the API. He shows some sample output for each - basic user information (nested arrays) and some of his activities (again, nested arrays). He includes the source for his sample application that pulls a user's profile information and lists out their latest (public) activities.

0 comments voice your opinion now!
googleplus api introduction sample library application


PHPBuilder.com:
Introducing the Yii PHP Framework
April 27, 2011 @ 11:03:43

In another in his framework series, Jason Gilmore has a new post on PHPBuilder.com about another popular framework - the Yii framework. He introduces you to the framework and shows the creation of a sample, basic site.

Frameworks have been the topic du jour here at PHPBuilder.com, with numerous recent articles covering DooPHP and Fat-free. In this latest stop on the framework tour, we'll check out Yii, a relatively new framework (less than three years old) that boasts an impressive array of features and an equally impressive array of users, among them the enormously popular Stay.com.

He walks you through the install (downloading the latest version) and shows how to use the command-line tool to automatically generate the basic website structure. He continues on showing how to update the main page and template, how to get it connected to a MySQL database and how to use the Gii tool to create basic admin forms for working with the tables.

0 comments voice your opinion now!
yii framework tutorial introduction sample website admin mysql


MySQL Performance Blog:
Sample datasets for benchmarking and testing
February 09, 2011 @ 13:19:28

In a recent post to the MySQL Performance Blog, there's a pointer to a few resources you can use if you need some sample datasets to run your application against - everything from airline flight information to energy usage data.

Sometimes you just need some data to test and stress things. But randomly generated data is awful - it doesn't have realistic distributions, and it isn't easy to understand whether your results are meaningful and correct. Real or quasi-real data is best. Whether you're looking for a couple of megabytes or many terabytes, the following sources of data might help you benchmark and test under more realistic conditions.

The sample data sets vary from fake movie information to sample site traffic data to the large data sets that Amazon provides (including the Human Genome and US Census data). Some of the comments also link to other sources.

0 comments voice your opinion now!
sample dataset application random source



Community Events





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


introduction security list podcast series symfony opinion library language conference voicesoftheelephpant laravel composer version framework community tool artisanfiles release interview

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