【问题标题】:cakephp form/date helperscakephp 表单/日期助手
【发布时间】:2010-09-07 06:45:16
【问题描述】:

我有 3 个 dropdwons 用于日月和年。直到最近,我才将它们组合起来,以 mysql 格式将 date_of_inspection 保存在数据库中。我正在使用日、月和年 cakephp 表单助手。这就是我正在做的事情

$this->data['Cabinet']['date_of_inspection'] =
    $this->data['Cabinet']['date_of_inspection']['year'].'-'.
    $this->data['Cabinet']['date_of_inspection']['month'].'-'.
    $this->data['Cabinet']['date_of_inspection']['day'];

我删除了上面的行,日期仍然以 mysql 日期格式存储。怎么会 ?? cakephp 能做到吗?

【问题讨论】:

    标签: php cakephp


    【解决方案1】:

    简而言之,是的。作为保存过程的一部分,日期和时间“子数组”会自动deconstructed

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-04-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多