 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Sebastian Bergmann's Blog: Generating Code from Tests
by Chris Cornutt 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.
voice your opinion now!
phpunit generate code unittest testfirst programming
Pieter's Blog: Zend_Form with XML Tutorial
by Chris Cornutt 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).
voice your opinion now!
zendform zendframework xml generate tutorial example
Builder.com.au: Generating PDF Files with PHP and FPDF
by Chris Cornutt 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.
voice your opinion now!
pdflib fpdf generate tutorial free library
|
Community Events
Don't see your event here? Let us know!
|