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


PHP Debugbar::addMessage方法代码示例

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


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

示例1: traitEntityEdit

 function traitEntityEdit()
 {
     //соберем форму
     $this->traitEntityEdit_formBuild();
     $this->form->initValues($this->model->toForm());
     $this->traitEntityEdit_formBuildAfter();
     if ($this->form->isSubmitted()) {
         $model_class = static::getClassModel();
         $data = $this->form->getValue();
         $data['id'] = $this->model->id;
         $validator = $model_class::getDataValidator($data, $this->form);
         //            dd($data);
         if ($validator->validate()) {
             //запись успешно сохранена
             $this->traitEntity_save($validator);
             //выведем сообщение об успешной вставке
             return $this->traitEntityEdit_success();
         } else {
             \Debugbar::addMessage($validator->getErrors());
             $this->form->setErrors($validator->getErrors());
             //$this->form->putTbStatic(\HtmlDiv::addClass('alert alert-danger')->setContent($validator->getErrors(true)));
         }
         //запись успешно сохранена
         //            $this->traitEntity_save();
         //            выведем сообщение об успешной вставке
         //            return $this->traitEntityEdit_success();
     }
     //форма показана в первый раз или с ошибками
     if (\Request::ajax()) {
         return $this->traitEntityEditJson();
     }
     return $this->traitEntityEditHtml();
 }
开发者ID:larakit,项目名称:lk,代码行数:33,代码来源:TraitControllerEntityItemEdit.php

示例2: traitEntityAdd

 function traitEntityAdd()
 {
     //соберем форму
     $this->traitEntityAdd_formBuild();
     $this->traitEntityAdd_formBuildAfter();
     /** @var Model $model_class */
     $model_class = static::getClassModel();
     if ($this->form->isSubmitted()) {
         $validator = $model_class::getDataValidator($this->form->getValue(), $this->form);
         if ($validator->validate()) {
             //запись успешно сохранена
             $this->traitEntity_save($validator);
             //выведем сообщение об успешной вставке
             return $this->traitEntityAdd_success();
         } else {
             //                dd($validator->getErrors());
             \Debugbar::addMessage($validator->getErrors());
             $this->form->setErrors($validator->getErrors());
         }
     } else {
         $fill_labels = $this->model->getFillable();
         foreach ($fill_labels as $fillable) {
             if (null !== \Input::get($fillable)) {
                 $this->form->initValues([$fillable => \Input::get($fillable)]);
             }
         }
     }
     //форма показана в первый раз или с ошибками
     if (\Request::ajax()) {
         return $this->traitEntityAddJson();
     } else {
         return $this->traitEntityAddHtml();
     }
 }
开发者ID:larakit,项目名称:lk,代码行数:34,代码来源:TraitControllerEntityAdd.php

示例3: getUserByCredential

 /**
  * @param $password
  * @param $loginName
  * @param bool $flag
  * @return Users
  */
 public function getUserByCredential($password, $loginName, $flag = null)
 {
     if ($flag == null) {
         $flag = false;
     }
     \Debugbar::info($flag);
     // TODO: Implement getUserByCredential() method.
     if (!$flag) {
         $user = $this->model->newQuery()->with('getGroup')->where('email', '=', $loginName)->where('ugroup', '!=', 2)->where('Active', '=', 1)->first();
         if ($user != null) {
             if (\Hash::check($password, $user->getPassword())) {
                 \Debugbar::addMessage('hash matches - ' . Hash::make($password));
                 return $user;
             } else {
                 \Debugbar::addMessage('hash dose not match');
                 return null;
             }
         } else {
             return null;
         }
     } else {
         $user = $this->model->newQuery()->with('getGroup')->where('Password', '=', $password)->where('email', '=', $loginName)->where('Active', '=', 1)->first();
         if ($user != null) {
             return $user;
         } else {
             return null;
         }
     }
 }
开发者ID:nickterekhin,项目名称:sj2,代码行数:35,代码来源:UsersModelImpl.php

示例4: console

 public static function console($var)
 {
     if (!class_exists('Debugbar') || app()->environment() === 'testing') {
         return;
     }
     \Debugbar::addMessage($var);
 }
开发者ID:xLink,项目名称:Portfolio,代码行数:7,代码来源:Debug.php

示例5: initElement

 /**
  * @param \HTML_QuickForm2_Node $element
  *
  * @return \HTML_QuickForm2_Node
  */
 function initElement(\HTML_QuickForm2_Node $element)
 {
     \Debugbar::addMessage(($this->namespace ? $this->namespace . '::' : '') . 'models/' . $this->model->getEntity() . '.' . $element->getName());
     $config = \Config::get(($this->namespace ? $this->namespace . '::' : '') . 'models/' . $this->model->getEntity() . '.' . $element->getName());
     if (is_array($config)) {
         foreach ($config as $k => $v) {
             $method = \Str::camel('set_' . $k);
             if (is_callable([$element, $method])) {
                 call_user_func([$element, $method], $v);
             }
         }
     }
     return $element;
 }
开发者ID:larakit,项目名称:lk,代码行数:19,代码来源:LaraFormBuilder.php

示例6: index

 public function index()
 {
     \Redis::set('name', 'alegriaghost');
     $name = \Redis::get('name');
     \Redis::del('name');
     \Debugbar::info($name);
     \Debugbar::warning($name);
     \Debugbar::error($name);
     \Debugbar::addMessage($name, '$name');
     var_dump($name);
     \Redis::set('name1', 'alegriaghost1');
     \Redis::set('name2', 'alegriaghost2');
     \Redis::set('name3', 'alegriaghost3');
     $list = Redis::keys('*');
     $values = Redis::mget($list);
     var_dump($list);
     var_dump($values);
 }
开发者ID:alegriaghost,项目名称:sample-program.based-laravel,代码行数:18,代码来源:SampleController.php

示例7: function

Route::get('/login', 'Auth\\AuthController@getLogin');
# Process login form
Route::post('/login', 'Auth\\AuthController@postLogin');
# Process logout
Route::get('/logout', 'Auth\\AuthController@getLogout');
# Show registration form
Route::get('/register', 'Auth\\AuthController@getRegister');
# Process registration form
Route::post('/register', 'Auth\\AuthController@postRegister');
// Debugging
Route::get('/practice', function () {
    $data = array('foo' => 'bar');
    Debugbar::info($data);
    Debugbar::error('Error!');
    Debugbar::warning('Watch out…');
    Debugbar::addMessage('Another message', 'mylabel');
    return 'Practice';
});
Route::get('/confirm-login-worked', function () {
    # You may access the authenticated user via the Auth facade
    $user = Auth::user();
    if ($user) {
        echo 'You are logged in.';
        dump($user->toArray());
    } else {
        echo 'You are not logged in.';
    }
    return;
});
Route::get('/debug', function () {
    echo '<pre>';
开发者ID:eldaronco,项目名称:p4,代码行数:31,代码来源:routes.php

示例8: function

|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', function () {
    return view('welcome');
});
/* Admin routes */
Route::get('admin/login', ['as' => 'login', function () {
    if (\Dobby::isLoggedIn()) {
        Debugbar::addMessage('redirect to admin');
        return redirect('admin');
    }
    return view('admin.login');
}]);
Route::post('admin/login', array('as' => 'login', 'uses' => 'Admin\\LoginController@login'));
Route::get('admin/logout', ['as' => 'logout', function () {
    Dobby::logout();
    return redirect('admin');
}]);
Route::get('logout', function () {
    Dobby::logout();
    return redirect('/');
});
Route::group(['middleware' => 'auth.dobby', 'prefix' => 'admin'], function () {
    Route::get('/', ['as' => 'admin', function () {
开发者ID:nickterekhin,项目名称:sj2,代码行数:31,代码来源:routes.php

示例9: getDataValidator

 /**
  * @param      $data
  * @param null $form
  *
  * @return DataValidator
  */
 static function getDataValidator($data, $form = null)
 {
     $v = static::getVendor();
     if ($v) {
         $v .= '::';
     }
     $filters = (array) \Config::get($v . 'models/' . static::getEntity() . '/filters');
     $rules = (array) \Config::get($v . 'models/' . static::getEntity() . '/rules');
     $rules = Arr::only($rules, array_keys($data));
     //        dump($data);
     //        dd($rules);
     //        dump($rules);
     //        \Debugbar::addMessage($rules);
     \Debugbar::addMessage($data);
     $labels = static::getEntityLabels();
     $messages = static::getEntityValidationMessage();
     \Debugbar::addMessage($labels);
     \Debugbar::addMessage($messages);
     foreach ($filters as $field => $field_filters) {
         //            $field_filters = ['trim'] + $field_filters;
         foreach ($field_filters as $field_filter) {
             $elements = $form ? $form->getElementsByName($field) : [];
             $options = [];
             $options[] = Arr::get($data, $field);
             if ($field_filter instanceof \Closure) {
                 $options[] = $data;
                 $options[] = $elements;
             }
             if (isset($data[$field])) {
                 $data[$field] = call_user_func_array($field_filter, $options);
             }
         }
     }
     $class = static::getClassDataValidator();
     $validator = new $class();
     return $validator->setData((array) $data)->setRules((array) $rules)->setLabels((array) $labels)->setMessages((array) $messages);
 }
开发者ID:larakit,项目名称:lk,代码行数:43,代码来源:TraitEntity.php

示例10: isLoggedIn

 /**
  *
  */
 public function isLoggedIn()
 {
     if ($this->request->session()->get('isLogged') == 1) {
         \Debugbar::addMessage("logged");
         return true;
     } else {
         \Debugbar::addMessage("not logged");
         return false;
     }
 }
开发者ID:nickterekhin,项目名称:sj2,代码行数:13,代码来源:Dobby.php


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