• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP helpers\Helper类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中app\helpers\Helper的典型用法代码示例。如果您正苦于以下问题:PHP Helper类的具体用法?PHP Helper怎么用?PHP Helper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: loadPage

 public function loadPage(Request $request)
 {
     $this->getChart($request);
     $result = new Helper();
     //$result->buildNavMenuNew();
     return View('linechart')->with('result', $result->buildNavMenu());
 }
开发者ID:cwelect1,项目名称:ART,代码行数:7,代码来源:lavaController.php


示例2: loadPage

 public function loadPage(Request $request)
 {
     $nav = new Helper();
     $runsModel = new \App\Run();
     //$runs = $this->getRuns();
     $runs = $runsModel->getRunsWithinXDays(90);
     $runs_for_dropdown = $runsModel->getRunsForDropdown();
     return view('Admin.edit')->with(['runs' => $runs, 'nav' => $nav->buildNavMenu(), 'runs_for_dropdown' => $runs_for_dropdown]);
 }
开发者ID:cwelect1,项目名称:ART,代码行数:9,代码来源:AddEditDeleteController.php


示例3: loadPage

 public function loadPage($id = null)
 {
     $runModel = new \App\Run();
     $run = $runModel->getRun($id);
     if (is_null($run)) {
         \Session::flash('flash_message', 'Run not found.');
         return redirect('/');
     }
     $nav = new Helper();
     return view('runs.single')->with(['nav' => $nav->buildNavMenu(), 'run' => $run]);
 }
开发者ID:cwelect1,项目名称:ART,代码行数:11,代码来源:TestRunController.php


示例4: getCharts

 public function getCharts($testResultTotals)
 {
     $chart = new Helper();
     $smoke = \Lava::DataTable();
     $integration = \Lava::DataTable();
     $regression = \Lava::DataTable();
     $smoke->addStringColumn('TestResults')->addNumberColumn('Percent')->addRow(array('Passed', $testResultTotals['Passed']))->addRow(array('Failed', $testResultTotals['Failed']))->addRow(array('Skipped', $testResultTotals['Skipped']));
     $integration->addStringColumn('TestResults')->addNumberColumn('Percent')->addRow(array('Passed', 90))->addRow(array('Failed', 5))->addRow(array('Skipped', 5));
     $regression->addStringColumn('TestTesults')->addNumberColumn('Percent')->addRow(array('Passed', 82))->addRow(array('Failed', 18))->addRow(array('Skipped', 20));
     $chart->getChart('SmokeTestChart', 'PieChart', 250, 250, array('078B3E', 'CD1E35', 'FCDC27'), $smoke);
     $chart->getChart('IntegrationTestChart', 'PieChart', 250, 250, array('078B3E', 'CD1E35', 'FCDC27'), $integration);
     $chart->getChart('RegressionTestChart', 'PieChart', 250, 250, array('078B3E', 'CD1E35', 'FCDC27'), $regression);
 }
开发者ID:cwelect1,项目名称:ART,代码行数:13,代码来源:DashboardController.php


示例5: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $thread_id
  * @param  int  $parent_id
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request, $thread_id, $parent_id = null)
 {
     $user_id = Auth::user()->id;
     $position = '';
     $depth = 0;
     $thread = DB::table('threads')->where('id', $thread_id)->first();
     if ($thread == null) {
         abort(404);
     }
     if ($parent_id != null) {
         $parent = DB::table('replies')->where('id', $parent_id)->first();
         if ($parent == null || $parent->thread_id != $thread_id) {
             abort(404);
         }
         $position = $parent->position;
         $depth = $parent->depth + 1;
     }
     // Validation
     $this->validate($request, ['content' => 'string|required']);
     $content = $request->input('content');
     $id = DB::table('replies')->insertGetId(['thread_id' => $thread_id, 'user_id' => $user_id, 'parent_id' => $parent_id, 'content' => $content, 'depth' => $depth]);
     $position = $position . Helper::appendZero($id, 5) . ',';
     DB::table('replies')->where('id', $id)->update(['position' => $position]);
     DB::table('threads')->where('id', $thread_id)->increment('comment_count');
     DB::table('users')->where('id', $user_id)->increment('comment_count');
     $author_id = DB::table('threads')->where('id', $thread_id)->first()->author_id;
     DB::table('notifications')->insert(['type' => 1, 'user_id' => $author_id, 'content_id' => $thread_id]);
     return redirect('/thread/' . $thread_id);
 }
开发者ID:rkkautsar,项目名称:CuapCuap,代码行数:37,代码来源:ReplyController.php


示例6: store

 /**
  * Admin login request
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $validator = Validator::make($request->all(), ['username' => 'required', 'password' => 'required']);
     if ($validator->fails()) {
         Flashy::error($validator->errors()->first());
         return back();
     }
     // If we have already set an admin user, do they match?
     if (Setting::has('admin_user')) {
         if ($request->username != Setting::get('admin_user')['username'] && $request->username != Setting::get('admin_user')['email']) {
             Flashy::error('Admin user is not recognised');
             return back();
         }
     }
     // Is this a valid plex user?
     $admin_user = (array) Helper::getPlexUser($request->username, $request->password);
     if (!$admin_user) {
         back();
     }
     // So, have we got an admin user already? If not, let's set that now.
     if (!Setting::has('admin_user')) {
         Flashy::success('Admin user has been set to ' . $request->username);
     }
     Setting::set('admin_user', $admin_user);
     Session::set('admin_user', $admin_user);
     return back();
 }
开发者ID:olipayne,项目名称:PlexReq,代码行数:33,代码来源:AdminHomeController.php


示例7: loginAction

 public function loginAction()
 {
     $fc = FrontController::getInstance();
     $model = new FrontModel();
     $userModel = new UserTableModel();
     if ($_SERVER['REQUEST_METHOD'] === 'POST') {
         $userModel->setTable('user');
         $userModel->setData();
         $userModel->login();
         $redirect = Helper::getRedirect();
         if (is_array($redirect) && !empty($redirect['url'])) {
             $redirect = implode('#', $redirect);
             header('Location: ' . $redirect);
             exit;
         }
         if ($fc->getAction() !== 'loginAction') {
             header('Location: ' . $_SERVER['REQUEST_URI']);
         } else {
             header('Location: ' . '/');
         }
         exit;
     } else {
         if ($_SESSION['user_id']) {
             header('Location: /');
         }
         $output = $model->render('../views/user/login.php', 'withoutSliderAndSidebar');
         $fc->setPage($output);
     }
 }
开发者ID:ralf000,项目名称:newshop,代码行数:29,代码来源:UserController.class.php


示例8: boot

 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     // image
     Blade::directive('image', function ($expression) {
         $externalUrl = "/img/";
         $expression = substr($expression, 2, strlen($expression) - 4);
         return "<?php echo '{$externalUrl}{$expression}'; ?>";
     });
     // breadcrumbs
     Blade::directive('breadcrumbs', function ($expression) {
         //            return "echo with{$expression}->format('m/d/Y H:i');
         $expression = \App\Helpers\Helper::substring($expression, 1, 1);
         $expression = \App\Helpers\Helper::stringRemove($expression, "'");
         $params = explode(", ", $expression);
         $string = "";
         $arrow = '<i class="fa fa-chevron-right navigation-arrow"></i>';
         for ($i = 0; $i < count($params) - 1; $i += 2) {
             $url = route($params[$i]);
             $title = $params[$i + 1];
             $string .= "<a href='{$url}'>{$title}</a>";
             if (isset($params[$i + 2])) {
                 $string .= $arrow;
             }
         }
         $string .= $params[count($params) - 1];
         //            return "< ? php echo with{$string}; ;
         return $string;
     });
 }
开发者ID:Ravaelles,项目名称:Elder,代码行数:34,代码来源:AppServiceProvider.php


示例9: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     for ($count = 1; $count <= 10; $count++) {
         $thread_id = rand(1, DB::table('threads')->count());
         $position = Helper::appendZero($count, 5);
         $user_id = rand(1, DB::table('users')->count());
         DB::table('replies')->insert(['thread_id' => $thread_id, 'user_id' => $user_id, 'content' => str_random(100), 'position' => $position . ',', 'depth' => 0]);
         DB::table('threads')->where('id', $thread_id)->increment('comment_count');
         DB::table('users')->where('id', $user_id)->increment('comment_count');
         $author_id = DB::table('threads')->where('id', $thread_id)->first()->author_id;
         DB::table('notifications')->insert(['type' => 1, 'user_id' => $author_id, 'content_id' => $count]);
     }
     for ($count = 11; $count <= 30; $count++) {
         $parent_id = rand(1, DB::table('replies')->count());
         $parent = DB::table('replies')->where('id', $parent_id)->first();
         $position = $parent->position . Helper::appendZero($count, 5) . ',';
         $thread_id = $parent->thread_id;
         $user_id = rand(1, DB::table('users')->count());
         DB::table('replies')->insert(['thread_id' => $thread_id, 'user_id' => $user_id, 'content' => str_random(100), 'parent_id' => $parent_id, 'depth' => $parent->depth + 1, 'position' => $position]);
         DB::table('threads')->where('id', $thread_id)->increment('comment_count');
         DB::table('users')->where('id', $user_id)->increment('comment_count');
         $author_id = DB::table('threads')->where('id', $thread_id)->first()->author_id;
         DB::table('notifications')->insert(['type' => 1, 'user_id' => $author_id, 'content_id' => $thread_id]);
     }
 }
开发者ID:rkkautsar,项目名称:CuapCuap,代码行数:30,代码来源:RepliesTableSeeder.php


示例10: getIndex

 /**
  * Returns a view with the user's profile form for editing
  *
  * @author [A. Gianotto] [<[email protected]>]
  * @since [v1.0]
  * @return View
  */
 public function getIndex()
 {
     // Get the user information
     $user = Auth::user();
     $location_list = Helper::locationsList();
     return View::make('account/profile', compact('user'))->with('location_list', $location_list);
 }
开发者ID:dmeltzer,项目名称:snipe-it,代码行数:14,代码来源:ProfileController.php


示例11: getCreate

 /**
  * Statuslabel create.
  *
  * @return View
  */
 public function getCreate()
 {
     // Show the page
     $statuslabel = new Statuslabel();
     $use_statuslabel_type = $statuslabel->getStatuslabelType();
     $statuslabel_types = Helper::statusTypeList();
     return View::make('statuslabels/edit', compact('statuslabel_types', 'statuslabel'))->with('use_statuslabel_type', $use_statuslabel_type);
 }
开发者ID:stijni,项目名称:snipe-it,代码行数:13,代码来源:StatuslabelsController.php


示例12: indexAction

 function indexAction()
 {
     $fc = FrontController::getInstance();
     $model = new FrontModel();
     $popProducts = (new IndexWidgets())->recAndPopProductsWidget('popular', 6);
     $recProducts = (new IndexWidgets())->recAndPopProductsWidget('recommended');
     $model->setData(['slides' => IndexWidgets::getSliderWidget(), 'currentCategory' => (new IndexWidgets())->currentCategoryWidget(Helper::getSiteConfig()->currentCategoryWidget), 'popularProducts' => Generator::popularProducts($popProducts, 6), 'recommendedProducts' => Generator::recommendedProducts($recProducts)]);
     $output = $model->render('../views/index.php', 'main');
     $fc->setPage($output);
 }
开发者ID:ralf000,项目名称:newshop,代码行数:10,代码来源:IndexController.class.php


示例13: validator

 /**
  * Validates input before processing user requests
  * @param  Array   $data array of fields to validate
  * @param  Array   $rules array of rules to apply
  * @return \Illuminate\Http\Response response if validation fails
  */
 public static function validator(array $data, array $rules, $redirectRoute)
 {
     // Validate
     $validator = Validator::make($data, $rules);
     // If validator fails get the errors and warn the user
     // this redirects to prevent further execution
     if ($validator->fails()) {
         $message = Helper::getValidationErrors($validator);
         return redirect()->route($redirectRoute)->with('message', $message);
     }
 }
开发者ID:AdaptiveAds,项目名称:AdaptiveAds,代码行数:17,代码来源:Helper.php


示例14: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     // dd(Helper::makePermissionsCRUD($request->privilege));
     $array_of_permissions = Helper::makePermissionsCRUD($request->privilege);
     foreach ($array_of_permissions as $key => $permission) {
         $privilege = new Privilege();
         $privilege->permission = $permission;
         $privilege->status_id = 1;
         $privilege->save();
     }
     return \Redirect::to('settings/roles');
 }
开发者ID:umahatokula,项目名称:academia,代码行数:18,代码来源:privilegesController.php


示例15: start

 public function start(Request $request)
 {
     if (empty(Session::get('session_id'))) {
         Helper::saveSession();
     } else {
         $session = Session::get('session_id');
         $existe = SaveSession::where('cookie', '=', $session)->first();
         if (empty($existe)) {
             Helper::saveSession();
         }
     }
     return redirect('cuando-comes-fuera-de-casa-vas-a');
 }
开发者ID:riverajefer,项目名称:vision,代码行数:13,代码来源:PreguntasController.php


示例16: postPermissiongen

 public function postPermissiongen(Request $request)
 {
     $special = [];
     #special permissions
     $special[0] = Helper::octalgen($request->input('setuid'), $request->input('setgid'), $request->input('stickybit'));
     #user permissions
     $special[1] = Helper::octalgen($request->input('userread'), $request->input('userwrite'), $request->input('userexecute'));
     #group permissions
     $special[2] = Helper::octalgen($request->input('groupread'), $request->input('groupwrite'), $request->input('groupexecute'));
     #other permissions
     $special[3] = Helper::octalgen($request->input('otherread'), $request->input('otherwrite'), $request->input('otherexecute'));
     return view('permissiongen.permissiongen', ['special' => $special]);
 }
开发者ID:smhillin,项目名称:p3,代码行数:13,代码来源:GeneratorController.php


示例17: compose

 public function compose(View $view)
 {
     $catTree = null;
     /* if(\Cache::has('tree')) {
                 $catTree = \Cache::get('tree');
             }
             else {
                 \Cache::put('tree', $this->category->get()->toTree(), Carbon::now()->addDay());
                 $catTree = \Cache::get('tree');
     
             }*/
     $catTree = $this->category->get()->toTree();
     $view->with('categories', Helper::treeToArray($catTree));
 }
开发者ID:yurilabatsevich,项目名称:test.dev,代码行数:14,代码来源:CategoryComposer.php


示例18: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id = 0)
 {
     if ($id == 0) {
         $id = Auth::user()->id;
     }
     $user = DB::table('users')->where('id', $id)->first();
     if ($user == null) {
         return abort(401);
     }
     if ($user->profile_picture !== null) {
         $user->profile_picture = Helper::getUserResource($user->profile_picture, $user->id);
     }
     return view('show_profile', ['user' => $user]);
 }
开发者ID:rkkautsar,项目名称:CuapCuap,代码行数:20,代码来源:UserController.php


示例19: addAllImages

 function addAllImages()
 {
     if (!empty($this->mainImage)) {
         $mImage = str_replace('//', '/', $this->path . 'main_' . Generator::strToLat($this->mainImage));
         $this->addImage($mImage, TRUE);
         Helper::moveFile('mainimage', TRUE, $this->productId);
     }
     if (!empty($this->images[0]) && is_array($this->images)) {
         foreach ($this->images as $img) {
             $image = str_replace('//', '/', $this->path . Generator::strToLat($img));
             $this->addImage($image, FALSE);
         }
         Helper::moveFile('images', FALSE, $this->productId);
     }
 }
开发者ID:ralf000,项目名称:newshop,代码行数:15,代码来源:ImageTableModel.class.php


示例20: emailHandler

 public static function emailHandler($to = FALSE)
 {
     try {
         if (!$to) {
             $to = Helper::getSiteConfig()->contactinfo->siteMail->value;
         }
         if (empty(self::$data)) {
             throw new Exception('Класс не инициализирован должным образом');
         }
         self::emailSender((string) $to, self::$data['subject'], self::$data['message'], self::$data['email']);
         return TRUE;
     } catch (Exception $ex) {
         Session::setUserMsg('Пожалуйста, заполните все поля формы', 'danger');
         header('Location: ' . $_SERVER['REQUEST_URI']);
     }
 }
开发者ID:ralf000,项目名称:newshop,代码行数:16,代码来源:Mailer.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Controllers\App类代码示例发布时间:2022-05-23
下一篇:
PHP func\Proc类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap