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


PHP Alert::success方法代码示例

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


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

示例1: store

 public function store()
 {
     $data = Input::all();
     if (isset($data['phone_number'])) {
         $data['phone_number'] = str_replace(' ', '', $data['phone_number']);
     }
     if (isset($data['work_phone'])) {
         $data['work_phone'] = str_replace(' ', '', $data['work_phone']);
     }
     $u = new User();
     $a = false;
     $role_id = Input::get('role_id');
     if ($role_id == Config::get('constants.ROLE_BUYER')) {
         $a = new Buyer();
         $u->status = 2;
         $data['skip_verification'] = true;
     } elseif ($role_id == Config::get('constants.ROLE_SELLER')) {
         $a = new Seller();
     } elseif ($role_id == Config::get('constants.ROLE_BROKER')) {
         $a = new Broker();
     } else {
         //we don't know this role or attempt to register unlisted role
         unset($data['role_id']);
     }
     if (!isset($data['password']) || $data['password'] == "") {
         $pwd = Str::random(10);
         $data['password'] = $data['password_confirmation'] = $pwd;
     }
     if ($u->validate($data)) {
         if ($a && $a->validate($data)) {
             if (isset($pwd)) {
                 Session::set('validate_password', true);
             }
             $data['password'] = Hash::make($data['password']);
             $u->fill($data);
             $code = Str::random(10);
             $u->verification_code = $code;
             $data['verification_code'] = $code;
             $u->save();
             $data['user_id'] = $u->id;
             $a->fill($data);
             $a->save();
             $email = $u->email;
             if (isset($data['skip_verification'])) {
                 $data['url']['link'] = url('/');
                 $data['url']['name'] = 'Go to CompanyExchange';
                 Mail::queue('emails.templates.welcome', $data, function ($message) use($email) {
                     $message->from('listings@ng.cx', 'CompanyExchange');
                     $message->to($email);
                     $message->subject('Welcome to CompanyExchange');
                 });
             } else {
                 Mail::queue('emails.templates.progress', $data, function ($message) use($email) {
                     $message->from('listings@ng.cx', 'CompanyExchange');
                     $message->to($email);
                     $message->subject('Welcome to CompanyExchange');
                 });
             }
             if ($role_id == Config::get('constants.ROLE_BUYER')) {
                 Auth::loginUsingId($u->id);
                 Alert::success('Welcome to CompanyExchange. Please feel free to browse through our listings and contact sellers you would like to buy from.', 'Congratulations');
                 return Redirect::to('search?q=')->withSuccess("Welcome {$u->first_name}. Use the form on the left to search for listed businesses or browse the most recent listings below");
             }
             return Redirect::to('login')->withSuccess('Registration successful. Please check email to activate your account');
         }
         Input::flash();
         return View::make('users.register')->withErrors($a ? $a->getValidator() : []);
     }
     Input::flash();
     return View::make('users.register')->withErrors($u->getValidator());
 }
开发者ID:remix101,项目名称:compex,代码行数:71,代码来源:UsersController.php

示例2: destroy

 public function destroy($id)
 {
     $category = $this->categoriesRepo->findOrFail($id);
     $this->categoriesRepo->delete($category);
     \Alert::success("CMS::categories.msg_category_deleted");
     return redirect()->route('CMS::admin.categories.index');
 }
开发者ID:socieboy,项目名称:reactor-cms,代码行数:7,代码来源:CategoriesController.php

示例3: test_uses_magic_methods

 function test_uses_magic_methods()
 {
     // Having
     Alert::success('Success!');
     Alert::info('Some information');
     // Expect
     $this->assertTemplate('alerts/magic', Alert::render());
 }
开发者ID:clemir,项目名称:html-integration-tests,代码行数:8,代码来源:AlertContainerTest.php

示例4: getLogin

 /**
  * this code below was made by 
  * Joko Irianto
  */
 public function getLogin(Request $request)
 {
     // notification that account was regist
     if (\Session::has('message')) {
         \Session::forget('message');
         \Alert::success('Akun anda telah terdaftar, Silahkan login', 'Selamat!')->persistent("close");
     }
     return view('auth.login');
 }
开发者ID:jojoarianto,项目名称:sprint,代码行数:13,代码来源:AuthController.php

示例5: generateContent

 function generateContent()
 {
     if (isset($_GET['ip'])) {
         Framework::$autoLoader->importFolder(dirname($this->paths['utils']) . '/classes');
         $geoip = new GeoIP();
         $result = $geoip->getCountry(value($_GET['ip']));
         if ($result) {
             return Alert::success('<h4>Maxmind GeoIP</h4>IP: <b>' . $_GET['ip'] . '</b> is located in <b>' . $result['country'] . '</b> (' . $result['code'] . ')');
         } else {
             return Alert::error('<h4>Maxmind GeoIP</h4>IP: <b>' . $_GET['ip'] . '</b> is not found in the country database.');
         }
     } else {
         return new Form(array('method' => 'get', 'fields' => array(new Input(array('name' => 'ip', 'placeholder' => 'IP address')), new Input(array('type' => 'submit', 'value' => 'Lookup', 'class' => 'btn btn-primary'))), 'class' => 'input-append'));
     }
 }
开发者ID:sledgehammer,项目名称:geoip,代码行数:15,代码来源:GeoIPLookupUtil.php

示例6: toggleStatus

 public function toggleStatus($id)
 {
     $article = $this->articlesRepo->findOrFail($id);
     $data = '';
     $message = null;
     if ($article->published_at == null) {
         $data['published_at'] = Carbon::now();
         $message = 'CMS::articles.msg_article_published';
     } else {
         $data['published_at'] = null;
         $message = 'CMS::articles.msg_article_unpublished';
     }
     $this->articlesRepo->update($article, $data);
     \Alert::success($message);
     return redirect()->route('CMS::admin.articles.edit', $article->id);
 }
开发者ID:Cuacha07,项目名称:simple-cms,代码行数:16,代码来源:ArticlesController.php

示例7: postAccountInfo

 public function postAccountInfo(Request $request)
 {
     // validate the name
     $validation_rules["name"] = "required|min:5";
     // if the email has changed, validate that too
     if (\Auth::user()->email != $request->input('email')) {
         $validation_rules["email"] = "required|email|min:5|unique:users";
     }
     $validator = \Validator::make($request->all(), $validation_rules);
     if ($validator->fails()) {
         // The given data did not pass validation
         return redirect()->back()->withInput()->withErrors($validator->errors());
     }
     // update the info
     $user = User::findOrFail(\Auth::user()->id);
     $user->name = $request->input('name');
     $user->email = $request->input('email');
     $user->save();
     // set a success/error message
     \Alert::success(trans('auth.information_updated'))->flash();
     // redirect to the edit personal info page
     return redirect()->back();
 }
开发者ID:tahirghori,项目名称:dick,代码行数:23,代码来源:UserController.php

示例8: update

 /**
  * Update the specified resource in the database.
  *
  * @param  int  $id
  * @return Response
  */
 public function update(UpdateRequest $request = null)
 {
     // if edit_permission is false, abort
     if (isset($this->crud['edit_permission']) && !$this->crud['edit_permission']) {
         abort(403, 'Not allowed.');
     }
     $model = $this->crud['model'];
     $this->prepareFields($model::find(\Request::input('id')));
     $all_variables = \Request::all();
     // if the change_password field has been filled, change the password
     if ($all_variables['change_password'] != '') {
         $all_variables['password'] = $all_variables['change_password'];
     }
     $item = $model::find(\Request::input('id'))->update(parent::compactFakeFields($all_variables));
     // if it's a relationship with a pivot table, also sync that
     foreach ($this->crud['fields'] as $k => $field) {
         if (isset($field['pivot']) && $field['pivot'] == true) {
             $model::find(\Request::input('id'))->{$field}['name']()->sync(\Request::input($field['name']));
         }
     }
     // show a success message
     \Alert::success(trans('crud.update_success'))->flash();
     return \Redirect::to($this->crud['route']);
 }
开发者ID:tahirghori,项目名称:dick,代码行数:30,代码来源:UserCrudController.php

示例9: dirname

// Installation Header
require dirname(ROUTE_SECOND_PATH) . "/includes/install_header.php";
// Attempt to cheat
if (Database::initRoot('mysql')) {
    Database::exec("CREATE DATABASE IF NOT EXISTS `" . $dbName . '`');
}
// Check if the standard user is properly configured after POST values were used
if (Database::initialize($dbName)) {
    Alert::success("DB User", "The database user has access to the `" . $dbName . "` database!");
} else {
    Alert::error("DB User", "The `" . $dbName . "` database does not exist, or the user does not have access to it.");
    $userAccess = false;
}
// Check if the admin user is properly configured after POST values were used
if (Database::initRoot($dbName)) {
    Alert::success("DB Admin", "The administrative database user has access to the `" . $dbName . "` database!");
} else {
    if ($userAccess) {
        Alert::error("DB Admin", "The `" . $dbName . "` database exists, but you do not have administrative privileges.");
    } else {
        Alert::error("DB Admin", "The `" . $dbName . "` database does not exist, or you do not have administrative privileges.");
    }
}
// If everything is successful:
if (Validate::pass()) {
    // Check if the form was submitted (to continue to the next page)
    if (Form::submitted("install-db-connect")) {
        header("Location: /install/classes-core");
        exit;
    }
}
开发者ID:SkysteedDevelopment,项目名称:Deity,代码行数:31,代码来源:config-database.php

示例10: header

// Make sure that there is a valid application path
if (!defined("APP_PATH")) {
    Alert::error("Improper App Path", "You must set a valid application or application path.");
} else {
    if (!Dir::exists(APP_PATH)) {
        Alert::error("Invalid App Path", "You must set a valid application or application path.");
    }
}
// If the server configuration are acceptable
if (Validate::pass()) {
    // Check if the form was submitted (to continue to the next page)
    if (Form::submitted("install-site-config")) {
        header("Location: /install/config-database");
        exit;
    }
    Alert::success("Site Config", "Your site configurations are valid!");
}
// Installation Header
require dirname(ROUTE_SECOND_PATH) . "/includes/install_header.php";
// Run Global Script
require dirname(ROUTE_SECOND_PATH) . "/includes/install_global.php";
// Display the Header
require HEADER_PATH;
echo '
<form class="uniform" action="/install/config-site" method="post">' . Form::prepare("install-site-config");
echo '
<h3>Update Your Site Configurations:</h3>
<p>Config File: ' . PUBLIC_PATH . '/index.php</p>
<p style="margin-top:12px;">Make sure the following values are set properly:</p>

<p>
开发者ID:SkysteedDevelopment,项目名称:Deity,代码行数:31,代码来源:config-site.php

示例11:

        <?php 
Action::run('admin_header');
?>

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7/html5shiv.js"></script>
      <script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.js"></script>
    <![endif]-->
    </head>
    <body class="login-body">

        <?php 
// Monstra Notifications
Notification::get('success') and Alert::success(Notification::get('success'));
Notification::get('warning') and Alert::warning(Notification::get('warning'));
Notification::get('error') and Alert::error(Notification::get('error'));
?>

        <div class="container form-signin">

            <div class="text-center"><a class="brand" href="<?php 
echo Option::get('siteurl');
?>
/admin"><img src="<?php 
echo Option::get('siteurl');
?>
/public/assets/img/monstra-logo-256px.png" alt="monstra" /></a></div>
            <div class="administration-area well">
                <div>
开发者ID:rowena-altastratus,项目名称:altastratus,代码行数:30,代码来源:login.template.php

示例12: createAction

 /**
  * 新建页面
  * @author zhangteng
  */
 public function createAction()
 {
     //栏目
     $data['category'] = $this->category->categoryList(['parentid' => 7], 0, 50);
     //判断是否有值提交
     if ($this->getRequest()->isPost()) {
         //内容插入数据库
         $ret = $this->page->insert('page', ['title' => $this->getRequest()->getPost('title', ''), 'catid' => $this->getRequest()->getPost('catid', 0), 'keywords' => $this->getRequest()->getPost('keywords', ''), 'listorder' => intval($this->getRequest()->getPost('listorder')), 'url' => filter_var($this->getRequest()->getPost('url'), FILTER_VALIDATE_URL) ? $this->getRequest()->getPost('url') : '', 'description' => $this->getRequest()->getPost('descripion', '') ? $this->getRequest()->getPost('descripion', '0') : trim(misc::remove_nbsp(mb_substr(strip_tags($content), 0, 78, 'UTF-8'))), 'inputtime' => $_SERVER['REQUEST_TIME'], 'status' => 99, 'content' => addslashes(stripslashes($this->getRequest()->getPost('content', '')))]);
         if ($ret) {
             Alert::success('添加成功!');
             $this->redirect('/admin/page/index');
         } else {
             $referer = isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : '/admin/page/index';
             $this->redirect($referer);
         }
     }
     $this->getView()->assign('data', $data);
 }
开发者ID:290329416,项目名称:guahao,代码行数:22,代码来源:Page.php

示例13: deleteAction

 public function deleteAction()
 {
     $id = intval($this->getRequest()->getQuery('id'));
     if ($this->member->has(['id' => $id])) {
         $this->member->delete(['id' => $id]);
         Alert::success('删除成功!');
     } else {
         Alert::success('没有此用户!');
     }
     $this->redirect($_SERVER["HTTP_REFERER"] ? $_SERVER["HTTP_REFERER"] : '/admin/managemember/index');
 }
开发者ID:290329416,项目名称:guahao,代码行数:11,代码来源:Managemember.php

示例14: changeSubStatus

 /**
  * 改变子类的状态
  */
 public function changeSubStatus()
 {
     $subclass_id = $this->getRequest()->getQuery('sid');
     if (!$subclass_id) {
         Alert::danger("非法请求");
         Yaf_Controller_Abstract::redirect($this->referer);
         exit;
     }
     //判断当前操作者是否具有权限
     if (!$this->checkrole($subclass_id, "topic_subclass")) {
         Alert::danger("权限出错");
         Yaf_Controller_Abstract::redirect($this->referer);
         exit;
     }
     $data['status'] = $this->getRequest()->getQuery('status');
     if ($this->topic->update_subclass($subclass_id, $data)) {
         Alert::success("权限出错");
     } else {
         Alert::danger("权限出错");
     }
     Yaf_Controller_Abstract::redirect("/admin/topicsubclass/index/");
     exit;
 }
开发者ID:290329416,项目名称:guahao,代码行数:26,代码来源:Topicsubclass.php

示例15: articlesettingAction

 public function articlesettingAction()
 {
     exit;
     if ($this->getRequest()->getPost('dosubmit', 0)) {
         $data = $this->getRequest()->getPost('config');
         if ($data) {
             foreach ($data as $key => $value) {
                 $this->db_config->update_option(['conf_value' => $value], ['conf_name' => $key]);
             }
             Alert::success("操作成功");
             Yaf_Controller_Abstract::redirect($this->referer);
             exit;
         }
     } else {
         $data = $this->db_config->get_config();
         $this->getView()->assign("data", $data);
     }
 }
开发者ID:290329416,项目名称:guahao,代码行数:18,代码来源:Config.php


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