本文整理汇总了PHP中BaseForm::getForm方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseForm::getForm方法的具体用法?PHP BaseForm::getForm怎么用?PHP BaseForm::getForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseForm
的用法示例。
在下文中一共展示了BaseForm::getForm方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bookBuyAction
public function bookBuyAction()
{
if (!$this->thisController->id) {
return $this->thisController->displayAjax(false, '参数有误');
}
$book_info = self::$service->getBook($this->thisController->id);
if (!$book_info) {
return $this->thisController->displayAjax(false, '参数有误');
}
if (IS_POST) {
$form = BaseForm::getForm('BookOrderForm');
if (!$form->isValid($this->thisController->request->getPost())) {
foreach ($form->getMessages() as $message) {
return $this->thisController->displayAjax(false, $message->getMessage());
}
}
//写入数据
$data = $this->thisController->request->getPost();
$data['number'] = st_order_number();
$data['book_id'] = $this->thisController->id;
if ($book_info->getPrice() <= 0) {
$data['pay_status'] = 2;
$data['status'] = 3;
//已支付
} else {
$data['pay_status'] = 1;
$data['status'] = 4;
//未支付
}
$data['price'] = $book_info->getPrice();
$data['good_id'] = 0;
$data['credit'] = 0;
$data['uid'] = $this->thisController->user->id;
$result = self::$service->insertCommon($data, 'Order');
return $this->thisController->ajax($result);
}
}