Base::__get PHP Method

__get() public method

Alias for offsetget()
public __get ( $key ) : mixed
$key string
return mixed
    function &__get($key)
    {
        $val =& $this->offsetget($key);
        return $val;
    }

Usage Example

示例#1
0
 /**
  * 获取参数值
  * @param $name
  * @return bool|mixed|string
  */
 public function __get($name)
 {
     global $zbp;
     if ($name == 'SourceType') {
         if ($this->Source == 'system') {
             return 'system';
         } elseif ($this->Source == 'user') {
             return 'user';
         } elseif ($this->Source == 'theme') {
             return 'theme';
         } elseif ($this->Source == 'plugin_' . $zbp->theme) {
             return 'theme';
         } else {
             return 'plugin';
         }
     }
     if ($name == 'NoRefresh') {
         return (bool) $this->Metas->norefresh;
     }
     if ($name == 'Name' && $this->Source == 'system') {
         switch ($this->FileName) {
             case 'calendar':
                 return $zbp->lang['msg']['calendar'];
             case 'controlpanel':
                 return $zbp->lang['msg']['control_panel'];
             case 'searchpanel':
                 return $zbp->lang['msg']['search'];
             default:
                 return $zbp->lang['msg']['module_' . $this->FileName];
         }
     }
     return parent::__get($name);
 }
All Usage Examples Of Base::__get