本文整理汇总了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) {