本文整理汇总了PHP中AppModel::edit方法的典型用法代码示例。如果您正苦于以下问题:PHP AppModel::edit方法的具体用法?PHP AppModel::edit怎么用?PHP AppModel::edit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppModel
的用法示例。
在下文中一共展示了AppModel::edit方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
public function edit($id = 0)
{
$this->fields['file_name']['visible'] = false;
$this->fields['file_content']['visible'] = false;
parent::edit($id);
$this->render = 'edit';
}
示例2: edit
public function edit($id = 0)
{
parent::edit($id);
$this->render = 'edit';
}
示例3: edit
public function edit($id = 0)
{
$model = $this->alias;
$dateFormat = 'Y-m-d H:i:s';
if ($this->request->is(array('post', 'put'))) {
$startDate = $this->request->data[$model]['start_date'];
$startTime = $this->request->data[$model]['start_time'];
$endTime = $this->request->data[$model]['end_time'];
$this->request->data[$model]['start_time'] = date($dateFormat, strtotime($startDate . ' ' . $startTime));
$this->request->data[$model]['end_time'] = date($dateFormat, strtotime($startDate . ' ' . $endTime));
}
parent::edit($id);
$temp_date = new DateTime($this->request->data[$model]['start_time']);
$this->request->data[$model]['start_date'] = $temp_date->format('d-m-Y');
$temp_date = new DateTime($this->request->data[$model]['start_time']);
$this->request->data[$model]['start_time'] = $temp_date->format('h:i A');
$temp_date = new DateTime($this->request->data[$model]['end_time']);
$this->request->data[$model]['end_time'] = $temp_date->format('h:i A');
$this->render = 'edit';
}