我有以下内容:
class HP_Utils {
/**********************************************************************/
public static function getAction()
/**********************************************************************/
{
  if( isset( $_GET[ 'action' ] ) ) {
    return $_GET[ 'action' ];
  }
  else if ( isset( $_POST[ 'action' ] )) {
    return $_POST[ 'action' ];
  }
}
/**********************************************************************/
}
然后在其他班级:
$this->utils = $this->load( 'helper', 'Utils' );
$action = $this->utils::getAction(); <============== ERROR
装载机:
abstract class MController {
/**********************************************************************/
protected function load( $type, $className ) {
  switch( $type ) {
    case 'model':
      $name = 'MD_' . $className;
      break;
    case 'view':
      $name = 'VW_' . $className;
      break;
    case 'helper';
      $name = 'HP_' . $className;
      break;
  }
  $path = $type . '/' . $name . '.php';
  include( $path );
  return new $name;
}
给我错误:
PHP 解析错误:语法错误,第 11 行 /home/jorgee/www/menu/controller/CT_Menu.php 中的意外 '::' (T_PAAMAYIM_NEKUDOTAYIM)
显然我对静态方法的访问很糟糕,但我认为这就是方法,有什么帮助吗?