News Feed
Jobs Feed
Sections

Recent Jobs

News Archive
feed this:

Eirik Hoem's Blog:
Populate PDF templates with PHP / FPDF / FPDI
May 08, 2008 @ 11:11:55

Eirik Hoem recently pointed out two libraries that can be used in PHP to generate PDF files dynamically - FPDF and FPDI.

Ever wanted to generated PDF documents on the fly with PHP? Perhaps populate a standard contract with a customers name and address? FPDF and FPDI are two neat libraries which greatly helps when working with PDF files.

FPDF handles most of the work of creating and working with the PDF files while FPDI works together with it to pull in existing PDF files so FPDF can modify them. He links to some sample code you can try out once you've installed the two libraries.

0 comments voice your opinion now!
pdf generate fpdf fpdi template populate



Stefan Priebsch's Blog:
PHPUnit test and Code Coverage Statistics with phing
April 22, 2008 @ 14:15:18

Stefan Priebsch has posted an example of how he uses PHPUnit "manually" to reduce the overhead (and added complexity) of calling phing.

Instead of instantiating PHPUnit from phing, I use the command line interface to call PHPUnit. This decouples phing and PHPUnit, which should cause less problems with version updates in the future. To configure PHPUnit, phing creates a temporary XML configuration file which is deleted after PHPUnit has finished.

The source is included in the post - it manually builds the XML file needed for phing to do its job.

1 comment voice your opinion now!
phing phpunit codecoverage statistic generate xml


Developer Tutorials Blog:
RSS feeds in PHP 3 simple steps to PHP RSS generation
April 17, 2008 @ 08:47:50

On the Developer Tutorials blog today, there's a new post talking about the "three easy steps" to making an RSS feed for your blog:

Adding an RSS feed to your site is quick and painless, and can be done with pure PHP (and some kind of data source). After the jump, 3 simple steps to building an RSS feed in php.

The steps are pretty simple - figure out what content you want to serve, set up the basic RSS XML structure, and loop through your data to push it in to the template and echoed out. Some simple example code is included.

0 comments voice your opinion now!
rss feed generate tutorial steps example code content


Sebastian Bergmann's Blog:
Generating Code from Tests
March 13, 2008 @ 08:43:50

Sebastian Bergmann has posted a quick example of how to use the PHPUnit unit testing suite for PHP to create code for you (assuming you're using the test first method of development.

His example builds the class off of a set of test for a "BowlingGame" that ends up with roll() and score() methods based off of the naming conventions used in the test:

Following the convention that the tests for a class BowlingGame (see below) are written in a class named BowlingGameTest (see above), the test case class' source is searched for variables that reference objects of the BowlingGame class and analyzing what methods are called on these objects.
0 comments voice your opinion now!
phpunit generate code unittest testfirst programming


Pieter's Blog:
Zend_Form with XML Tutorial
March 10, 2008 @ 12:57:00

Pieter has blogged today with an example of using an XML configuration file together with the Zend_Form component of the Zend Framework to create a simple form - in his example, a login form.

During my interneship if been busy with Zend_Form and XML and now I like to share it with you. So here is a very easy, complete example that shows it in action. Let's make a small login form from XML with Zend_Form.

The Zend Framework has the functionality for this already built in - a call to create a Zend_Config_Xml object passing in the XML file's name is all it takes. He includes a sample XML file that shows the setup of the form as well as how to perform some of the validation techniques (like checking length and pattern matching).

0 comments voice your opinion now!
zendform zendframework xml generate tutorial example


Developer Tutorials:
Easy PDF Generation in PHP
March 04, 2008 @ 09:57:00

On the Developer Tutorials website, they're posted this new article talking about a simple way to create PDFs with PHP:

[PDFs] also serve as a perfect way of allowing your users to download or email a page from your website. In this tutorial, I'll show you how to generate PDF files in pure PHP and distribute your content in a single, consistent format.

They look at the why behind creating PDFs in PHP, what options you have and an example creating a basic "hello world" PDF.

0 comments voice your opinion now!
pdf generate tutorial introduction example code


Builder.com.au:
Generating PDF Files with PHP and FPDF
February 20, 2008 @ 08:42:00

The Builder.com.au website has a new tutorial posted today that looks at the dynamic creation of a web standard (PDF files) inside of a PHP script.

An alternative way of generating PDF files with PHP is using FPDF, a free PHP class containing a number of functions for creating and manipulating PDFs. The key word here is free. You are free to download and use this class or customise it to fit your needs. In addition to being free, it's also simpler to use than PDFlib. The PDFlib needs to be installed as an extension in your PHP package, whereas FPDF can just be included in your PHP script and it's ready to use

They show how to use the FPDF library to make some simple files - setting the title, author, adding images and text, etc. There's even a little bit there at the end about adding new pages to make more complex documents simple.

0 comments voice your opinion now!
pdflib fpdf generate tutorial free library


Zend Developer Zone:
Generating and Validating Web Forms With PEAR HTML_QuickForm (part 2)
January 22, 2008 @ 07:57:00

The Zend Developer Zone has released part two of a series (here's part one posted back in November) looking at making forms for your website with the help of the PEAR HTML_QuickForm class.

I'll be discussing some of the package's non-standard form elements, teaching you how to combine elements into groups, showing you how to apply templates to control a form's appearance, and guiding you through the process of writing and registering your own custom validation rules.

There's plenty of sample code and screenshots to go around in this second part including examples of form auto-completion, multi-select elements and and example of its integration with Smarty.

0 comments voice your opinion now!
form generate validate pear htmlquickform series


Sebastian Bergmann's Blog:
Profiling and Optimizing PHPUnit
October 23, 2007 @ 07:54:00

Sebastian Bergmann has posted about a bottle neck in the PHPUnit unit testing software for PHP:

Now that collecting code coverage information is not slow anymore (as of Xdebug 2.0.1), PHPUnit's report generation code (PHPUnit_Util_Report_*) has become a bottleneck.

There are several images included in the post (output of KCachegrind):

0 comments voice your opinion now!
phpunit xdebug bottleneck generate report kcachegrind phpunit xdebug bottleneck generate report kcachegrind


Michael Kimsal's Blog:
Generate random test data
August 16, 2007 @ 13:34:44

Michael Kimsal points out a small utility to create information he found himself needing over and over - information that looks like, but is not, personal details.

I put together a small utility to generate random user data several months back. I realized yesterday that I hadn't released the source code - I thought I had. This generates plausible names, addresses, phone numbers and social security numbers. The phone number area codes don't generally match up with the address, but the addresses are accurate in that the city/state/zip all match. The addresses are currently US-based only. The code will also generate SQL statements for you to insert directly in to your database if selected.

You can download the PHP code for yourself or just use his copy to generate some sample information when you need it.

0 comments voice your opinion now!
script generate random test data personal information script generate random test data personal information



Community Events











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


conference job zendframework example mysql database ajax cakephp book PEAR security framework PHP5 package releases application code developer zend release

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