关于设置属性的注意事项

时间:2015-03-17 22:19:32

标签: php properties

我收到了这个通知:

  

间接修改重载属性ReadData_model :: $ err   没效果

在这一行:

$this->err{$target . '_db'} = '<div class="alert alert-danger" role="alert">Sorry, we could not connect to your <strong>' . $target . ' database</strong>. Plese check your entries and try connecting again.</div>';

我实际上是在尝试设置动态属性。

通知意味着什么,我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

我试着像这样解决它并且有效:

$this->{'err_' . $target . '_db'} = 'whatever';