News Feed
Sections




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

DevShed:
Using Static Methods to Build Loader Apps in PHP
June 04, 2009 @ 10:27:42

Continuing their look at static methods in PHP, DevShed has posted this new tutorial (the second in the series) focusing on using the methods to create a simple loader application.

As its name suggests, a file loading program (or a resource loading program, to express the concept more accurately), is simply a PHP module that takes care of including, usually via its set of "include()/require() native functions, files that are required by an application to make it work as expected. [...] It's worthwhile to mention, however, that it was necessary to create an instance of the aforementioned class to load a determined file. This is a process that can be completely avoided in terms of good coding habits. But how can this be achieved? Well, it's feasible to statically call the class's load()" method, preventing its unwanted instantiation.

The code examples of the simple loader class (a require_once wrapped in a try/catch) and a usage example.

0 comments voice your opinion now!
loader static tutorial


blog comments powered by Disqus

Similar Posts

Community News: PHPEasy.co.uk Launched

NETTUTS.com: How to Squeeze the Most out of LESS

ZendCasts.com: Creating RSS & Atom Feeds with Zend_Feed

NetTuts.com: Build Web Apps From Scratch With Laravel: Filters, Validations, and Files

IBM developerWorks: What's new in PHP V5.2, Part 4: Using the new ZIP extension


Community Events

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


configure part2 framework community php7 performance api series release conference introduction podcast interview example voicesoftheelephpant library application laravel symfony2 opinion

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