直接那样调用可以实现的,楼主把问题说清楚点.根据传进的$ID,那就判断下$ID.

解决方案 »

  1.   

    class Mgr 
    {      
    require_once("../config/config.php"); 
        //get div 
        static function getDiv($ID) 
        { 
            return portalConfig::$$ID;//根据传进的$ID,调用制定的层的参数,例如$top; 
        } 

    比如要调用 $top
    使用方法就是:
    $array = Mgr::getDiv('top');
    这样就可以了
      

  2.   

    测试过的。
    可以的      
    要调用配置中的   $bottom 
    就是$array = Mgr::getDiv('bottom ');
      

  3.   


    <?phpfunction portalConfig($ID) 

        $top = array( 
                            "height" => "100px", 
                            "width" => "980px", 
                            "margin" => "0", 
                            "background" => "transparent url(images/top.jpg)" 
                    ); 
        $bottom = array(
                       "height" => "100px" 
                       ); 
       if ($ID==1) {
        return $top;
       }elseif ($ID==2){
        return $bottom;
       }
    } class Mgr 
    {      
        //get div 
        static function getDiv($ID) 
        { 
            return portalConfig($ID);//根据传进的$ID,调用制定的层的参数,例如$top; 
        } 
    } ?>
      

  4.   

    已经调试好了,将portalConfig::$ID改成portalConfig::$$ID即可以了~~~~~~