本文整理匯總了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('商品特征值已更新');