CList を使用する基本的な関数があります。何らかの理由で次のエラーが発生します。
CList and its behaviors do not have a method or closure named "setReadOnly".
私のphpコード
$list = new CList(array('python', 'ruby'));
$anotherList = new Clist(array('php'));
var_dump($list);
$list->mergeWith($anotherList);
var_dump($list);
$list->setReadOnly(true); // CList and its behaviors do not have a method or closure named "setReadOnly".
このエラーが発生する理由を誰か説明できますか?
PS私はこのコードを最近のYiiの本から直接コピーしました...だから私は少し困惑しています
// 更新: mergeWith() の前後に var_dump を追加しました
object(CList)[20]
private '_d' =>
array (size=2)
0 => string 'python' (length=6)
1 => string 'ruby' (length=4)
private '_c' => int 2
private '_r' => boolean false
private '_e' (CComponent) => null
private '_m' (CComponent) => null
object(CList)[20]
private '_d' =>
array (size=3)
0 => string 'python' (length=6)
1 => string 'ruby' (length=4)
2 => string 'php' (length=3)
private '_c' => int 3
private '_r' => boolean false
private '_e' (CComponent) => null
private '_m' (CComponent) => null