我在我的类别lang表中添加了一个额外的日期字段。所有数据都正确保存但是当试图在renderForm中显示数据时,我没有得到任何值。如果我将类型更改为“text”,则值显示正常。
任何帮助都会受到赞赏,因为我现在已经搜索了很多,而且没有答案。我也尝试在数据库表中编辑字段类型。
这是我的renderForm方法和我遇到问题的字段:
public function renderForm() {
$this->fields_form_override = array(
array(
'type' => 'datetime',
'label' => $this->l('Startdato'),
'name' => 'cat_start_date',
'lang' => true,
'autoload_rte' => true,
'hint' => 'Fx 14. september'
),
这是我的分类类覆盖:
public $cat_start_date;
public $cat_end_date;
public $cat_order_due_date;
public $cat_location;
public $cat_special_msg;
public function __construct($id_category = null, $id_lang = null, $id_shop = null) {
self::$definition['fields']['cat_start_date'] = array('type' => self::TYPE_DATE, 'lang' => true, 'validate' => 'isDate');
self::$definition['fields']['cat_end_date'] = array('type' => self::TYPE_DATE, 'lang' => true, 'validate' => 'isDate');
self::$definition['fields']['cat_order_due_date'] = array('type' => self::TYPE_DATE, 'lang' => true, 'validate' => 'isDate');
self::$definition['fields']['cat_location'] = array('type' => self::TYPE_STRING, 'lang' => true);
self::$definition['fields']['cat_special_msg'] = array('type' => self::TYPE_STRING, 'lang' => true);
parent::__construct($id_category, $id_lang, $id_shop);
}
答案 0 :(得分:0)
您的datetime
字段必须为:
lang => false