本文整理匯總了PHP中group::add方法的典型用法代碼示例。如果您正苦於以下問題:PHP group::add方法的具體用法?PHP group::add怎麽用?PHP group::add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類group
的用法示例。
在下文中一共展示了group::add方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: add
/**
Adds a new group @return boolean
@throws Exception
*/
public function add()
{
global $__in, $__out;
if ($__in['__is_form_submitted']) {
// if form is submitted
try {
$group = new group();
$group->add($__in['group']);
return dispatcher::redirect("getall", "added_successfully");
} catch (ValidationException $ex) {
$ex->publish_errors();
$__out['group'] = $__in['group'];
return false;
} catch (Exception $ex) {
throw $ex;
}
} else {
// if form is not submitted
$__out['group'] = array();
return true;
}
// end if form submitted
}
示例2: strpos
if ($process > -1) {
$condition .= " AND process={$process}";
}
$timetype = strpos($dorder[$order], 'add') !== false ? 'add' : '';
}
switch ($action) {
case 'add':
if ($submit) {
if ($do->pass($post)) {
if ($FD) {
fields_check($post_fields);
}
if ($CP) {
property_check($post_ppt);
}
$do->add($post);
if ($FD) {
fields_update($post_fields, $table, $do->itemid);
}
if ($CP) {
property_update($post_ppt, $moduleid, $post['catid'], $do->itemid);
}
if ($MOD['show_html'] && $post['status'] > 2) {
$do->tohtml($do->itemid);
}
dmsg('添加成功', '?moduleid=' . $moduleid . '&action=' . $action);
} else {
msg($do->errmsg);
}
} else {
foreach ($do->fields as $v) {
示例3: intval
if ($setting['fee_mode']) {
//收費會員
if ($vip > 9) {
$do->vip = $vip = 9;
}
if ($vip < 1) {
$do->vip = $vip = 1;
}
$setting['fee'] = intval($setting['fee']);
if ($setting['fee'] < 1) {
$setting['fee'] = 3000;
}
} else {
$do->vip = $vip = $setting['fee'] = 0;
}
$do->add($setting);
dmsg('添加成功', $this_forward);
} else {
include load('homepage.lang');
$do->groupid = 7;
extract($do->get_one());
$groupname = '';
$discount = 100;
$menuid = 0;
include tpl('group_edit', $module);
}
} else {
if ($action == 'edit') {
$groupid or msg();
if ($submit) {
if (!$groupname) {