本文整理匯總了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);
}
}