これは、参照フィールドのコード例を単純に書き直したものです。
class page_LoadResults extends Page {
function init(){
parent::init();
$p=$this;
$f=$p->add('Form');
$c=$p->add('Model_Season');
$f->addField('reference','Season')
->setValueList($c)
->validateNotNull()
->add('Icon',null,'after_field')
->set('arrows-left3')
->addStyle('cursor','pointer')
->js('click',$f->js()->reload())
;
呼び出すと、次のエラー メッセージが表示されます。
\atk4\lib\Form/Field.php:652 [2] htmlspecialchars() は、パラメーター 1 が文字列であると想定し、配列を指定します
コードを見ると、Field.php の 648 行目あたり
foreach($this->getValueList() as $value=>$descr){
// Check if a separator is not needed identified with _separator<
$output.=
$this->getOption($value)
.htmlspecialchars($descr)
.$this->getTag('/option');
}
確かに ($value,descr) の配列として $descr を作成しているようです
これはバグですか、それともベースから外れていますか。ありがとう。