本文整理匯總了PHP中CComponent::__set方法的典型用法代碼示例。如果您正苦於以下問題:PHP CComponent::__set方法的具體用法?PHP CComponent::__set怎麽用?PHP CComponent::__set使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CComponent
的用法示例。
在下文中一共展示了CComponent::__set方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __set
/**
* Any requests to set or get attributes or call methods on this class that
* are not found are redirected to the {@link Swift_Mime_Message} object.
* @param string the attribute name
*/
public function __set($name, $value)
{
try {
return parent::__set($name, $value);
} catch (CException $e) {
$setter = 'set' . $name;
if (method_exists($this->message, $setter)) {
$this->message->{$setter}($value);
} else {
throw $e;
}
}
}
示例2: __set
public function __set($name, $val)
{
try {
return parent::__set($name, $val);
} catch (CException $e) {
$method_name = Yii::app()->text->underscoreToCamelcase($name);
$method_name = 'set' . ucfirst($method_name);
if (method_exists($this, $method_name)) {
return $this->{$method_name}($val);
} else {
throw new CException($e->getMessage());
}
}
}
示例3: __set
public function __set($name, $value)
{
$setter = 'set' . $name;
if (false !== method_exists($this, $setter)) {
return call_user_func_array(array($this, $setter), array($value));
} else {
if (false !== property_exists($this, $name)) {
return $this->{$name} = $value;
} else {
if (false !== $this->getIsProxy() && false !== method_exists($this->_instance, $setter)) {
return call_user_func_array(array($this->_instance, $setter), array($value));
} else {
if (false !== $this->getIsProxy() && false !== property_exists($this->_instance, $name)) {
return $this->_instance->{$name} = $value;
}
}
}
}
return parent::__set($name, $value);
}
示例4: __set
public function __set($strName, $mixValue)
{
switch ($strName) {
case 'objCart':
$this->objCart = $mixValue;
return;
case 'CheckoutForm':
$this->CheckoutForm = $mixValue;
return;
default:
return parent::__set($strName, $mixValue);
}
}