本文整理汇总了PHP中Errors::merge方法的典型用法代码示例。如果您正苦于以下问题:PHP Errors::merge方法的具体用法?PHP Errors::merge怎么用?PHP Errors::merge使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Errors
的用法示例。
在下文中一共展示了Errors::merge方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_errors
function show_errors()
{
// display errors
if ($this->errors) {
if (!$this->errors_to_function) {
echo '<ul class="errors">';
foreach ($this->errors as $name => $error) {
echo '<li><div class="error_icon"></div>' . ucfirst(str_ireplace('[field]', $name, $error)) . '</li>';
}
echo '</ul><div class="clear"> </div>';
} else {
Errors::merge($this->errors);
}
}
}
示例2: foreach
foreach ($items as $order => $id) {
if (in_array('page_map_reorders', $table_fields) && $table == 'admin_pages') {
$rec = DB::getRecord('admin_pages', $id, 0, 1);
if ($rec['page_map_reorders'] > 0) {
continue;
}
}
DB::update($table, array('order' => $i), $id);
$i++;
}
}
}
if (is_array($_REQUEST['page_map'])) {
if (is_array($_REQUEST['page_map']['methods'])) {
foreach ($_REQUEST['page_map']['methods'] as $order => $id) {
DB::update('admin_controls_methods', array('order' => $order), $id);
}
}
if (is_array($_REQUEST['page_map']['pages'])) {
foreach ($_REQUEST['page_map']['pages'] as $order => $id) {
DB::update('admin_pages', array('order' => $order, 'page_map_reorders' => 1), $id);
}
}
}
if (!$errors) {
Messages::add($CFG->ajax_save_message);
Messages::display();
} else {
Errors::merge($errors);
Errors::display();
}
示例3: sendSMS
static function sendSMS($authy_id = false)
{
global $CFG;
API::add('User', 'sendSMS', array($authy_id));
$query = API::send();
$response = $query['User']['sendSMS']['results'][0];
if (!$response || !is_array($response)) {
Errors::add(Lang::string('security-com-error'));
} elseif ($response['success'] == false) {
Errors::merge($response['errors']);
} else {
return true;
}
}
示例4: array
} else {
API::token($token1);
if ($_REQUEST['action'] == 'edit') {
API::add('APIKeys', 'edit', array($permissions));
} elseif ($_REQUEST['action'] == 'add') {
API::add('APIKeys', 'add');
} elseif ($_REQUEST['action'] == 'delete') {
API::add('APIKeys', 'delete', array($remove_id1));
}
$query = API::send();
if (!empty($query['error'])) {
if ($query['error'] == 'security-com-error') {
Errors::add(Lang::string('security-com-error'));
}
if ($query['error'] == 'authy-errors') {
Errors::merge($query['authy_errors']);
}
if ($query['error'] == 'security-incorrect-token') {
Errors::add(Lang::string('security-incorrect-token'));
}
}
if ($_REQUEST['action'] == 'delete' && !$query['APIKeys']['delete']['results'][0]) {
Link::redirect('api-access.php?error=delete');
}
if (!is_array(Errors::$errors)) {
if ($_REQUEST['action'] == 'edit') {
Link::redirect('api-access.php?message=edit');
} elseif ($_REQUEST['action'] == 'add') {
$secret = $query['APIKeys']['add']['results'][0];
Messages::add(Lang::string('api-add-message'));
$info_message = str_replace('[secret]', $secret, Lang::string('api-add-show-secret'));
示例5: saveToDB
function saveToDB()
{
global $CFG;
if (!User::isLoggedIn()) {
return false;
}
$table = $table ? $table : 'cart';
if (is_array($_SESSION['cart'])) {
foreach ($_SESSION['cart'] as $row) {
$row['user_id'] = User::$info['id'];
if (!DB::insert($table, $row)) {
$id = $row['item_id'];
$errors[$id] = $CFG->cart_item_conversion_error;
}
}
}
if ($errors) {
Errors::merge($errors);
return false;
} else {
return true;
}
}