View Single Post
Old 04-12-2008, 10:03 PM   #8 (permalink)
Garrett
The Wanderer
 
Join Date: Apr 2008
Posts: 6
Thanks: 0
Garrett is on a distinguished road
Default

I made a function for this a while back for a project I was doing. You define each of your classes, and you can select them through the function.
PHP Code:
include_select(array("upload""lastfm")); 
PHP Code:
function include_select ($array) {

    
$label = array("lastfm"  => array("file" => "lastfm.php"),
                    
"connect" => array("file" => "connect.php"),
                    
"upload" => array("file" => "uploader.php"),
                    
"imdb" => array("file" => "imdb.php"),
                    
"imdb_parser" => array("file" => "imdb_parser.php"),
                    
"pagination" => array("file" => "pagination.php"),
                    
"pagination-layout" => array("file" => "pagination-layout.php"),
                    
"page-layout" => array("file" => "page-layout.php"),
                    
"twitter" => array("file" => "twitter.php"));

    while (list(
$key) = each($label)) {
        if(
in_array($key$array)) {
            include(
"classes/".$label[$key]['file']);
        }
    }
    

Garrett is offline  
Reply With Quote