当前位置: 首页>>代码示例>>PHP>>正文


PHP Msg::show方法代码示例

本文整理汇总了PHP中Msg::show方法的典型用法代码示例。如果您正苦于以下问题:PHP Msg::show方法的具体用法?PHP Msg::show怎么用?PHP Msg::show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Msg的用法示例。


在下文中一共展示了Msg::show方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: content

 public function content($params = [])
 {
     $this->paramsParse($params);
     if (empty($this->template->config['noSysMsgAutoShow'])) {
         Msg::show();
     }
     if (!file_exists($this->template->contentPath)) {
         echo 'Content not found';
     } else {
         extract($this->contentData);
         include $this->template->contentPath;
     }
 }
开发者ID:krvd,项目名称:cms-Inji,代码行数:13,代码来源:View.php

示例2: foreach

<h3>Блокировки на счете</h3>
<?php 
$currency_id = !empty($_GET['currency_id']) ? (int) $_GET['currency_id'] : 0;
$wallets = App::$cur->money->getUserWallets();
if ($currency_id && empty($wallets[$currency_id])) {
    Msg::add('У вас нет такого кошелька');
    Msg::show();
    return;
}
if ($currency_id) {
    $ids = $wallets[$currency_id]->id;
} else {
    $ids = [];
    foreach ($wallets as $wallet) {
        $ids[] = $wallet->id;
    }
    $ids = implode(',', $ids);
}
$table = new \Ui\Table();
$table->setCols(['№', 'Кошелек', 'Сумма', 'Комментарий', 'Дата']);
//items pages
$pages = new \Ui\Pages($_GET, ['count' => \Money\Wallet\Block::getCount(['where' => ['wallet_id', $ids, 'IN']]), 'limit' => 20]);
$histories = \Money\Wallet\Block::getList(['where' => ['wallet_id', $ids, 'IN'], 'order' => [['date_create', 'DESC'], ['id', 'DESC']], 'start' => $pages->params['start'], 'limit' => $pages->params['limit']]);
foreach ($histories as $history) {
    $amount = $history->amount;
    $table->addRow([$history->id, $history->wallet->currency->name(), '<span class = "' . ($amount > 0 ? "text-success" : 'text-danger') . '">' . $amount . '</span>', $history->comment, $history->date_create]);
}
$table->draw();
$pages->draw();
开发者ID:krvd,项目名称:cms-Inji,代码行数:29,代码来源:walletBlocked.php

示例3: checkRequest

 public function checkRequest($params = [], $ajax = false)
 {
     if (!$this->checkAccess()) {
         $this->drawError('you not have access to "' . $this->modelName . '" manager with name: "' . $this->formName . '"');
         return [];
     }
     $successId = 0;
     if (!empty($_POST[$this->requestFormName][$this->modelName])) {
         $request = $_POST[$this->requestFormName][$this->modelName];
         if ($this->model) {
             $presets = !empty($this->form['preset']) ? $this->form['preset'] : [];
             if (!empty($this->form['userGroupPreset'][\Users\User::$cur->group_id])) {
                 $presets = array_merge($presets, $this->form['userGroupPreset'][\Users\User::$cur->group_id]);
             }
             $afterSave = [];
             $error = false;
             foreach ($this->inputs as $col => $param) {
                 if (!empty($presets[$col])) {
                     continue;
                 }
                 if (is_object($param)) {
                     $afterSave[] = $param;
                     continue;
                 }
                 if (!empty($this->form['userGroupReadonly'][\Users\User::$cur->group_id]) && in_array($col, $this->form['userGroupReadonly'][\Users\User::$cur->group_id])) {
                     continue;
                 }
                 $inputClassName = '\\Ui\\ActiveForm\\Input\\' . ucfirst($param['type']);
                 $input = new $inputClassName();
                 $input->activeForm = $this;
                 $input->activeFormParams = $params;
                 $input->modelName = $this->modelName;
                 $input->colName = $col;
                 $input->colParams = $param;
                 try {
                     $input->validate($request);
                     $input->parseRequest($request);
                 } catch (\Exception $exc) {
                     \Msg::add($exc->getMessage(), 'danger');
                     $error = true;
                 }
             }
             if (!$error && empty($_GET['notSave'])) {
                 foreach ($presets as $col => $preset) {
                     if (!empty($preset['value'])) {
                         $this->model->{$col} = $preset['value'];
                     } elseif (!empty($preset['userCol'])) {
                         if (strpos($preset['userCol'], ':')) {
                             $rel = substr($preset['userCol'], 0, strpos($preset['userCol'], ':'));
                             $param = substr($preset['userCol'], strpos($preset['userCol'], ':') + 1);
                             $this->model->{$col} = \Users\User::$cur->{$rel}->{$param};
                         } else {
                             $this->model->{$col} = \Users\User::$cur->{$preset['userCol']};
                         }
                     }
                 }
                 if (!$this->parent) {
                     if (!empty($this->form['successText'])) {
                         $text = $this->form['successText'];
                     } else {
                         $text = $this->model->pk() ? 'Изменения были успешно сохранены' : 'Новый элемент был успешно добавлен';
                     }
                     \Msg::add($text, 'success');
                 }
                 $this->model->save(!empty($params['dataManagerParams']) ? $params['dataManagerParams'] : []);
                 foreach ($afterSave as $form) {
                     $form->checkRequest();
                 }
                 if ($ajax) {
                     \Msg::show();
                 } elseif (!empty($_GET['redirectUrl'])) {
                     \Tools::redirect($_GET['redirectUrl'] . (!empty($_GET['dataManagerHash']) ? '#' . $_GET['dataManagerHash'] : ''));
                 }
                 $successId = $this->model->pk();
             }
         }
         if (!is_array($params) && is_callable($params)) {
             $params($request);
         }
     }
     return $successId;
 }
开发者ID:krvd,项目名称:cms-Inji,代码行数:82,代码来源:ActiveForm.php


注:本文中的Msg::show方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。