本文整理汇总了PHP中FeatureValue::copyFromPost方法的典型用法代码示例。如果您正苦于以下问题:PHP FeatureValue::copyFromPost方法的具体用法?PHP FeatureValue::copyFromPost怎么用?PHP FeatureValue::copyFromPost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FeatureValue
的用法示例。
在下文中一共展示了FeatureValue::copyFromPost方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: FeatureValue
<?php
if (Tools::G('id_feature') > 0) {
$id_feature = Tools::G('id_feature');
}
if (Tools::P('saveFeatureValue') == 'add' && Tools::P('id_feature') > 0) {
$featureV = new FeatureValue();
$featureV->copyFromPost();
$featureV->add();
if (is_array($featureV->_errors) and count($featureV->_errors) > 0) {
$errors = $featureV->_errors;
} else {
$_GET['id'] = $featureV->id;
UIAdminAlerts::conf('商品特征值已添加');
}
$id_feature = Tools::P('id_feature');
}
if (isset($_GET['id'])) {
$id = (int) $_GET['id'];
$obj = new FeatureValue($id);
$id_feature = $obj->id_feature;
}
if (Tools::P('saveFeatureValue') == 'edit') {
if (Validate::isLoadedObject($obj)) {
$obj->copyFromPost();
$obj->update();
}
if (is_array($obj->_errors) and count($obj->_errors) > 0) {
$errors = $obj->_errors;
} else {
UIAdminAlerts::conf('商品特征值已更新');