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


PHP Component::__get方法代码示例

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


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

示例1: __get

 /**
  * Check whether we have a plugin installed with that name previous firing up the call
  * @param string $name
  * @return mixed|void
  */
 public function __get($name)
 {
     if (ArrayHelper::keyExists($name, $this->getInstalledPlugins())) {
         return $this->getPlugin($name);
     }
     return parent::__get($name);
 }
开发者ID:sjaakp,项目名称:yii2-leaflet-extension,代码行数:12,代码来源:PluginManager.php

示例2: __get

 /**
  * @inheritdoc
  */
 public function __get($name)
 {
     if (property_exists($this->obj, $name)) {
         return $this->obj->{$name};
     }
     return parent::__get($name);
 }
开发者ID:omgdef,项目名称:yii2-unisender,代码行数:10,代码来源:UniSender.php

示例3: getValue

 protected function getValue($name)
 {
     if (isset(static::$_modules[$name])) {
         return Yii::createObject(static::$_modules[$name]);
     }
     return parent::__get($name);
 }
开发者ID:kousuutetu,项目名称:yii2-wechat,代码行数:7,代码来源:Wechat.php

示例4: __get

 /**
  * Getter magic method.
  * This method is overridden to support accessing components like reading properties.
  * @param string $name component or property name
  * @return mixed the named property value
  */
 public function __get($name)
 {
     if ($this->has($name)) {
         return $this->get($name);
     } else {
         return parent::__get($name);
     }
 }
开发者ID:sanggabee,项目名称:hellomedia-yii-basic,代码行数:14,代码来源:ServiceLocator.php

示例5: __get

 /**
  * @param string $name
  * @return mixed
  */
 public function __get($name)
 {
     try {
         parent::__get($name);
     } catch (\yii\base\UnknownPropertyException $e) {
         return $this->mailChimp->{$name};
     }
 }
开发者ID:bdart,项目名称:yii2-mailchimp,代码行数:12,代码来源:Mailchimp.php

示例6: __get

 public function __get($name)
 {
     if (property_exists($this->_api, $name)) {
         return $this->_api->{$name};
     } else {
         return parent::__get($name);
     }
 }
开发者ID:heartshare,项目名称:yii2-uploadcare,代码行数:8,代码来源:Api.php

示例7: __get

 /**
  * Any requests to set or get attributes or call methods on this class that
  * are not found are redirected to the {@link IService} object.
  * @param string $name the attribute name
  * @return mixed
  * @throws \Exception
  */
 public function __get($name)
 {
     try {
         return parent::__get($name);
     } catch (\Exception $e) {
         if (property_exists($this->_service, $name)) {
             return $this->_service->{$name};
         } else {
             throw $e;
         }
     }
 }
开发者ID:strong2much,项目名称:yii2-sms,代码行数:19,代码来源:SmsManager.php

示例8:

 /**
  * @param $name
  * @return \Google_Service|mixed
  */
 function __get($name)
 {
     if (!isset($this->services[$name])) {
         return parent::__get($name);
     }
     if (null === $this->serviceInstances[$name]) {
         /** @var \Google_Service $serviceClass */
         $serviceClass = $this->services[$name]["class"];
         $this->serviceInstances[$name] = new $serviceClass($this->getClient());
     }
     return $this->serviceInstances[$name];
 }
开发者ID:gillbeits,项目名称:yii2-google-api,代码行数:16,代码来源:GoogleApi.php

示例9: __get

 public function __get($name)
 {
     $property = '_' . $name;
     if (property_exists($this, $property) && $this->{$property} === null) {
         $className = '\\' . ucfirst($name);
         $this->{$property} = new $className($this->_module->account, $this->_module->password);
         return $this->{$property};
     }
     return parent::__get($name);
 }
开发者ID:INOVADADOS,项目名称:yii2-talma-zenvia,代码行数:10,代码来源:ApiComponent.php

示例10: __get

 /**
  * @param string $name
  * @return mixed
  * @throws \yii\base\UnknownPropertyException
  */
 public function __get($name)
 {
     if (isset($this->objects[$name])) {
         return $this->objects[$name];
     }
     return parent::__get($name);
 }
开发者ID:larryli,项目名称:ipv4-yii2,代码行数:12,代码来源:IPv4.php

示例11: __get

 public function __get($name)
 {
     return $this->canGetProperty($name) ? parent::__get($name) : $this->getWorker($name);
 }
开发者ID:voodoo-mobile,项目名称:yii2-bg-tasks,代码行数:4,代码来源:BackgroundTasks.php

示例12: __get

 public function __get($name)
 {
     if ($name != 'Mp' && substr($name, 0, 2) == 'Mp') {
         $className = 'ashdark\\wechat\\mp\\' . $name;
         if (class_exists($className)) {
             if (empty($this->_mp_arr[$name])) {
                 $this->_mp_arr[$name] = new $className(['mp' => $this->getMp()]);
             }
             return $this->_mp_arr[$name];
         }
     }
     return parent::__get($name);
 }
开发者ID:ashdark,项目名称:yii2-wechat-sdk,代码行数:13,代码来源:MpWechat.php

示例13: __get

 /**
  * Returns a property value based on its name.
  * Do not call this method. This is a PHP magic method that we override
  * to allow using the following syntax to read a property
  * <pre>
  * $value=$component->propertyName;
  * </pre>
  * @param string $name the property name
  * @return mixed the property value
  * @throws \yii\base\UnknownPropertyException if the property is not defined
  * @see __set
  */
 public function __get($name)
 {
     $getter = 'get' . $name;
     if (property_exists($this->getClient(), $name)) {
         return $this->getClient()->{$name};
     } elseif (method_exists($this->getClient(), $getter)) {
         return $this->{$getter}();
     }
     return parent::__get($name);
 }
开发者ID:yii2ext,项目名称:redis,代码行数:22,代码来源:Connection.php

示例14: __get

 /**
  * @param string $name
  * @return mixed
  * @throws UnknownPropertyException
  */
 public function __get($name)
 {
     $getter = 'get' . $name;
     if (method_exists($this->getZabbixObject(), $getter)) {
         return $this->getZabbixObject()->{$getter}();
     } elseif (method_exists($this, $getter)) {
         return parent::__get($name);
     } elseif (method_exists($this, 'set' . $name)) {
         throw new InvalidCallException('Getting write-only property: ' . get_class($this) . '::' . $name);
     } else {
         throw new UnknownPropertyException('Getting unknown property: ' . get_class($this) . '::' . $name);
     }
 }
开发者ID:fiamma06,项目名称:yii2-zabbix-api,代码行数:18,代码来源:ZabbixComponent.php

示例15: __get

 /**
  * Get the value of format pattern of current locale of application.
  * @param string $name
  * @return mixed
  */
 public function __get($name)
 {
     $pattern = $this->getPattern();
     if (isset($pattern[$name])) {
         return $pattern[$name];
     }
     return parent::__get($name);
 }
开发者ID:bupy7,项目名称:yii2-datetime-converter,代码行数:13,代码来源:Converter.php


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