NULL ::字符变化CakePHP 3表单

时间:2017-01-20 15:41:54

标签: php cakephp cakephp-3.0

我得到 NULL ::字符变化作为CakePHP 3中Form的值,因为我刚创建新实体时我希望它是空白的。 我使用的控制器代码是

public function add() {
    $audience = $this->Audiences->newEntity();
    $this->set(compact('audience', 'languages'));
    $this->set('_serialize', ['audience']);

在add.ctp中,我的代码重做表单是

echo $this->Form->create($audience, ['novalidate' => true]);
echo $this->Form->input('audience', ['type' => 'text']);

0 个答案:

没有答案