本文整理汇总了PHP中Component::__get方法的典型用法代码示例。如果您正苦于以下问题:PHP Component::__get方法的具体用法?PHP Component::__get怎么用?PHP Component::__get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Component
的用法示例。
在下文中一共展示了Component::__get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __get
/**
* Channel properties to the inner object
*
* @param type $name
* @return type
*/
public function __get($name)
{
try {
// try to get property of the inner object
return $this->proxy('getProperty', $name);
} catch (Exception $e) {
// check for property in the proxy...
return parent::__get($name);
}
}
示例2: __get
/**
* Property getters handler
* @param string $name Property name
* @return mixed Property value
* @throws \DomainException
* @see Controller::__get()
*/
public function __get($name)
{
switch ($name) {
case 'controller':
case 'action':
case 'view':
$attr = "_{$name}";
return $this->{$attr};
default:
return parent::__get($name);
}
}
示例3: __get
/**
* Property getters handler
* @param string $name Property name
* @return mixed Property value
* @throws \SNTools\PropertyException
* @see Component::__get()
*/
public function __get($name)
{
switch ($name) {
case 'module':
return $this->_module;
case 'action':
case 'view':
return $this->route->{$name};
default:
return parent::__get($name);
}
}
示例4: __get
/**
* Method to lazy load classes
*
* @return Object
*/
public function __get($name)
{
switch ($name) {
case '_CroogoPlugin':
case '_CroogoTheme':
if (!isset($this->{$name})) {
$class = substr($name, 1);
$this->{$name} = new $class();
if (method_exists($this->{$name}, 'setController')) {
$this->{$name}->setController($this->_controller);
}
}
return $this->{$name};
default:
return parent::__get($name);
}
}