当前位置: 首页>>代码示例>>PHP>>正文


PHP Base::__get方法代码示例

本文整理汇总了PHP中Base::__get方法的典型用法代码示例。如果您正苦于以下问题:PHP Base::__get方法的具体用法?PHP Base::__get怎么用?PHP Base::__get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Base的用法示例。


在下文中一共展示了Base::__get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __get

 /**
  * 获取参数值
  * @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);
 }
开发者ID:zblogcn,项目名称:zblogphp,代码行数:38,代码来源:module.php

示例2: __get

 /**
  * @param $name
  * @return mixed|string
  */
 public function __get($name)
 {
     global $zbp;
     if ($name == 'Url') {
         foreach ($GLOBALS['hooks']['Filter_Plugin_Tag_Url'] as $fpname => &$fpsignal) {
             $fpsignal = PLUGIN_EXITSIGNAL_NONE;
             $fpreturn = $fpname($this);
             if ($fpsignal == PLUGIN_EXITSIGNAL_RETURN) {
                 return $fpreturn;
             }
         }
         $backAttr = $zbp->option['ZC_ALIAS_BACK_ATTR'];
         $u = new UrlRule($zbp->option['ZC_TAGS_REGEX']);
         $u->Rules['{%id%}'] = $this->ID;
         $u->Rules['{%alias%}'] = rawurlencode($this->Alias == '' ? $this->{$backAttr} : $this->Alias);
         return $u->Make();
     }
     if ($name == 'Template') {
         $value = $this->data[$name];
         if ($value == '') {
             $value = $zbp->option['ZC_INDEX_DEFAULT_TEMPLATE'];
         }
         return $value;
     }
     return parent::__get($name);
 }
开发者ID:zblogcn,项目名称:zblogphp,代码行数:30,代码来源:tag.php

示例3: __get

 /**
  * 获取参数值
  * @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') {
         $n = 'module_norefresh_' . $this->FileName;
         if ($zbp->cache->HasKey($n) == true) {
             return true;
         } else {
             return false;
         }
     }
     return parent::__get($name);
 }
开发者ID:jdjjdkdkdm,项目名称:zblogphp,代码行数:31,代码来源:module.php

示例4:

 function __get($property)
 {
     if ($property == 'PostCount') {
         if (is_null($this->_PostCount)) {
             global $DB;
             $this->_PostCount = $DB->formdata->count(array('id' => $this->ID, 'field_id' => 'poster'), 'value');
         }
         return $this->_PostCount;
     } else {
         return parent::__get($property);
     }
 }
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:12,代码来源:UserForm.php

示例5: __get

 public function __get($sKey)
 {
     $mGet = parent::__get($sKey);
     if ($mGet !== null) {
         return $mGet;
     }
     if (isset($_SESSION['user'][$sKey])) {
         return $_SESSION['user'][$sKey];
     } else {
         return null;
     }
 }
开发者ID:s1im05,项目名称:tyampuru,代码行数:12,代码来源:user.class.php

示例6: __get

 public function __get($key)
 {
     if (substr($key, 0, 6) == 'scale_') {
         $factor = substr($key, 6);
         if (($split = strpos($factor, '_')) !== FALSE) {
             $x = substr($factor, 0, $split);
             $y = substr($factor, $split + 1);
         } else {
             $x = $factor;
             $y = 0;
         }
         return $this->scale($x, $y);
     }
     return parent::__get($key);
 }
开发者ID:phrenetictales,项目名称:eman,代码行数:15,代码来源:Picture.php

示例7: __get

 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';
         } else {
             return 'plugin';
         }
     }
     return parent::__get($name);
 }
开发者ID:jdjjdkdkdm,项目名称:zblogphp,代码行数:16,代码来源:module.php

示例8: __get

 public function __get($name)
 {
     global $zbp;
     if ($name == 'Url') {
         $u = new UrlRule($zbp->option['ZC_TAGS_REGEX']);
         $u->Rules['{%id%}'] = $this->ID;
         $u->Rules['{%alias%}'] = $this->Alias == '' ? urlencode($this->Name) : $this->Alias;
         return $u->Make();
     }
     if ($name == 'Template') {
         $value = $this->Data[$name];
         if ($value == '') {
             $value = $zbp->option['ZC_INDEX_DEFAULT_TEMPLATE'];
         }
         return $value;
     }
     return parent::__get($name);
 }
开发者ID:jdjjdkdkdm,项目名称:zblogphp,代码行数:18,代码来源:tag.php

示例9: __get

 /**
  * 获取参数值
  * @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;
     }
     return parent::__get($name);
 }
开发者ID:jdjjdkdkdm,项目名称:zblogphp,代码行数:26,代码来源:module.php

示例10: __get

 /**
  * @param $name
  * @return mixed|string
  */
 public function __get($name)
 {
     global $zbp;
     if ($name == 'Url') {
         $u = new UrlRule($zbp->option['ZC_AUTHOR_REGEX']);
         $u->Rules['{%id%}'] = $this->ID;
         $u->Rules['{%alias%}'] = $this->Alias == '' ? rawurlencode($this->Name) : $this->Alias;
         return $u->Make();
     }
     if ($name == 'Avatar') {
         foreach ($GLOBALS['hooks']['Filter_Plugin_Mebmer_Avatar'] as $fpname => &$fpsignal) {
             $fpreturn = $fpname($this);
             if ($fpreturn) {
                 $fpsignal = PLUGIN_EXITSIGNAL_NONE;
                 return $fpreturn;
             }
         }
         if ($this->_avatar) {
             return $this->_avatar;
         }
         $s = $zbp->usersdir . 'avatar/' . $this->ID . '.png';
         if (is_readable($s)) {
             $this->_avatar = $zbp->host . 'zb_users/avatar/' . $this->ID . '.png';
             return $this->_avatar;
         }
         $this->_avatar = $zbp->host . 'zb_users/avatar/0.png';
         return $this->_avatar;
     }
     if ($name == 'LevelName') {
         return $zbp->lang['user_level_name'][$this->Level];
     }
     if ($name == 'EmailMD5') {
         return md5($this->Email);
     }
     if ($name == 'StaticName') {
         if ($this->Alias) {
             return $this->Alias;
         }
         return $this->Name;
     }
     if ($name == 'Template') {
         $value = $this->data[$name];
         if ($value == '') {
             $value = $zbp->option['ZC_INDEX_DEFAULT_TEMPLATE'];
         }
         return $value;
     }
     if ($name == 'PassWord_MD5Path') {
         return md5($this->Password . $zbp->guid);
     }
     if ($name == 'IsGod') {
         if ($this->_isgod === true || $this->_isgod === false) {
             return $this->_isgod;
         } else {
             $sql = $zbp->db->sql->Select($zbp->table['Member'], '*', array(array('=', 'mem_Level', 1)), 'mem_ID ASC', 1, null);
             $am = $zbp->GetListType('Member', $sql);
             if ($am[0]->ID == $this->ID) {
                 $this->_isgod = true;
             } else {
                 $this->_isgod = false;
             }
             return $this->_isgod;
         }
     }
     return parent::__get($name);
 }
开发者ID:ijustyce,项目名称:zblogphp,代码行数:70,代码来源:member.php

示例11: __get

 /**
  * @param $name
  * @return int|mixed|null|string
  */
 public function __get($name)
 {
     global $zbp;
     if ($name == 'Url') {
         foreach ($GLOBALS['hooks']['Filter_Plugin_Category_Url'] as $fpname => &$fpsignal) {
             $fpsignal = PLUGIN_EXITSIGNAL_NONE;
             $fpreturn = $fpname($this);
             if ($fpsignal == PLUGIN_EXITSIGNAL_RETURN) {
                 return $fpreturn;
             }
         }
         $backAttr = $zbp->option['ZC_ALIAS_BACK_ATTR'];
         $u = new UrlRule($zbp->option['ZC_CATEGORY_REGEX']);
         $u->Rules['{%id%}'] = $this->ID;
         $u->Rules['{%alias%}'] = rawurlencode($this->Alias == '' ? $this->{$backAttr} : $this->Alias);
         return $u->Make();
     }
     if ($name == 'Symbol') {
         if ($this->ParentID == 0) {
             return;
         } else {
             $l = $this->Level;
             return str_repeat(' ', $l * 2 - 1) . '└';
         }
     }
     if ($name == 'Level') {
         return $this->GetDeep($this);
     }
     if ($name == 'SymbolName') {
         return $this->Symbol . htmlspecialchars($this->Name);
     }
     if ($name == 'Parent') {
         if ($this->ParentID == 0) {
             return null;
         } else {
             return $zbp->categorys[$this->ParentID];
         }
     }
     if ($name == 'Template') {
         $value = $this->data[$name];
         if ($value == '') {
             $value = $zbp->option['ZC_INDEX_DEFAULT_TEMPLATE'];
         }
         return $value;
     }
     if ($name == 'LogTemplate') {
         $value = $this->data[$name];
         if ($value == '') {
             $value = $zbp->option['ZC_POST_DEFAULT_TEMPLATE'];
         }
         return $value;
     }
     return parent::__get($name);
 }
开发者ID:ijustyce,项目名称:zblogphp,代码行数:58,代码来源:category.php

示例12: switch

 /**
  * Automatically generate some values if they are NULL
  **/
 function __get($var)
 {
     $value = parent::__get($var);
     if ($value === NULL) {
         switch ($var) {
             case 'caption':
                 $name = $this->name;
                 if ($name !== null) {
                     $value = ucwords($this->name);
                 }
                 break;
         }
     }
     return $value;
 }
开发者ID:qix,项目名称:phorms,代码行数:18,代码来源:Control.php

示例13: __get

 public function __get($name)
 {
     global $zbp;
     switch ($name) {
         case 'Category':
             return $zbp->GetCategoryByID($this->CateID);
             break;
         case 'Author':
             return $zbp->GetMemberByID($this->AuthorID);
             break;
         case 'StatusName':
             return $zbp->lang['post_status_name'][$this->Status];
             break;
         case 'Url':
             if ($this->Type == ZC_POST_TYPE_ARTICLE) {
                 $u = new UrlRule($zbp->option['ZC_ARTICLE_REGEX']);
             } else {
                 $u = new UrlRule($zbp->option['ZC_PAGE_REGEX']);
             }
             $u->Rules['{%id%}'] = $this->ID;
             if ($this->Alias) {
                 $u->Rules['{%alias%}'] = $this->Alias;
             } else {
                 $u->Rules['{%alias%}'] = urlencode($this->Title);
             }
             $u->Rules['{%year%}'] = $this->Time('Y');
             $u->Rules['{%month%}'] = $this->Time('m');
             $u->Rules['{%day%}'] = $this->Time('d');
             if ($this->Category->Alias) {
                 $u->Rules['{%category%}'] = $this->Category->Alias;
             } else {
                 $u->Rules['{%category%}'] = urlencode($this->Category->Name);
             }
             if ($this->Author->Alias) {
                 $u->Rules['{%author%}'] = $this->Author->Alias;
             } else {
                 $u->Rules['{%author%}'] = urlencode($this->Author->Name);
             }
             return $u->Make();
             break;
         case 'Tags':
             return $zbp->LoadTagsByIDString($this->Tag);
             break;
         case 'TagsCount':
             return substr_count($this->Tag, '{');
             break;
         case 'TagsName':
             return $this->TagsToNameString;
         case 'Template':
             $value = $this->Data[$name];
             if ($value == '') {
                 $value = GetValueInArray($this->Category->GetDataArray(), 'LogTemplate');
                 if ($value == '') {
                     $value = $zbp->option['ZC_POST_DEFAULT_TEMPLATE'];
                 }
             }
             return $value;
         case 'CommentPostUrl':
             foreach ($GLOBALS['Filter_Plugin_Post_CommentPostUrl'] as $fpname => &$fpsignal) {
                 $fpreturn = $fpname($this);
                 if ($fpreturn) {
                     return $fpreturn;
                 }
             }
             $key = '&key=' . md5($zbp->guid . $this->ID . date('Y-m-d'));
             return $zbp->host . 'zb_system/cmd.php?act=cmt&postid=' . $this->ID . $key;
             break;
         case 'ValidCodeUrl':
             return $zbp->validcodeurl . '?id=cmt';
             break;
         case 'Prev':
             static $_prev = null;
             if ($_prev !== null) {
                 return $_prev;
             }
             $articles = $zbp->GetPostList(array('*'), array(array('=', 'log_Type', 0), array('=', 'log_Status', 0), array('<', 'log_PostTime', $this->PostTime)), array('log_PostTime' => 'DESC'), array(1), null);
             if (count($articles) == 1) {
                 $_prev = $articles[0];
             } else {
                 $_prev = '';
             }
             return $_prev;
             break;
         case 'Next':
             static $_next = null;
             if ($_next !== null) {
                 return $_next;
             }
             $articles = $zbp->GetPostList(array('*'), array(array('=', 'log_Type', 0), array('=', 'log_Status', 0), array('>', 'log_PostTime', $this->PostTime)), array('log_PostTime' => 'ASC'), array(1), null);
             if (count($articles) == 1) {
                 $_next = $articles[0];
             } else {
                 $_next = '';
             }
             return $_next;
             break;
         default:
             return parent::__get($name);
             break;
     }
//.........这里部分代码省略.........
开发者ID:jdjjdkdkdm,项目名称:zblogphp,代码行数:101,代码来源:post.php

示例14: __get

 /**
  * @param $name
  * @return int|mixed|null|string
  */
 public function __get($name)
 {
     global $zbp;
     if ($name == 'Url') {
         $u = new UrlRule($zbp->option['ZC_CATEGORY_REGEX']);
         $u->Rules['{%id%}'] = $this->ID;
         $u->Rules['{%alias%}'] = $this->Alias == '' ? urlencode($this->Name) : $this->Alias;
         return $u->Make();
     }
     if ($name == 'Symbol') {
         if ($this->ParentID == 0) {
             return;
         } else {
             $l = $this->Level;
             if ($l == 1) {
                 return '&nbsp;└';
             } elseif ($l == 2) {
                 return '&nbsp;&nbsp;&nbsp;└';
             } elseif ($l == 3) {
                 return '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└';
             }
             return;
         }
     }
     if ($name == 'Level') {
         if ($this->ParentID == 0) {
             $this->RootID = 0;
             return 0;
         }
         if ($zbp->categorys[$this->ParentID]->ParentID == 0) {
             $this->RootID = $this->ParentID;
             return 1;
         }
         if ($zbp->categorys[$zbp->categorys[$this->ParentID]->ParentID]->ParentID == 0) {
             $this->RootID = $zbp->categorys[$this->ParentID]->ParentID;
             return 2;
         }
         if ($zbp->categorys[$zbp->categorys[$zbp->categorys[$this->ParentID]->ParentID]->ParentID]->ParentID == 0) {
             $this->RootID = $zbp->categorys[$zbp->categorys[$this->ParentID]->ParentID]->ParentID;
             return 3;
         }
         return 0;
     }
     if ($name == 'SymbolName') {
         return $this->Symbol . htmlspecialchars($this->Name);
     }
     if ($name == 'Parent') {
         if ($this->ParentID == 0) {
             return null;
         } else {
             return $zbp->categorys[$this->ParentID];
         }
     }
     if ($name == 'Template') {
         $value = $this->data[$name];
         if ($value == '') {
             $value = $zbp->option['ZC_INDEX_DEFAULT_TEMPLATE'];
         }
         return $value;
     }
     if ($name == 'LogTemplate') {
         $value = $this->data[$name];
         if ($value == '') {
             $value = $zbp->option['ZC_POST_DEFAULT_TEMPLATE'];
         }
         return $value;
     }
     return parent::__get($name);
 }
开发者ID:jdjjdkdkdm,项目名称:zblogphp,代码行数:73,代码来源:category.php

示例15: elseif

 function __get($property)
 {
     if (in_array($property, array('module', 'page', 'type', 'size', 'row', 'place', 'content'))) {
         $ipn = '_' . $property;
         if ($this->{$ipn} === false) {
             $this->ld();
         }
         return $this->{$ipn};
     } elseif ($property == 'settings') {
         if ($this->_settings === false) {
             $this->ld();
         }
         return $this->_settings;
     } else {
         return parent::__get($property);
     }
 }
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:17,代码来源:PageLayoutEditor.php


注:本文中的Base::__get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。