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


PHP View::with方法代码示例

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


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

示例1: compose

 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose($view)
 {
     if (!isset($view['categories'])) {
         $categories = ProductCategory::whereNull('category_id')->with('subitems')->get();
         $view->with('categories', $categories);
         $view->with('parent', null);
     }
 }
开发者ID:teewebapp,项目名称:product,代码行数:14,代码来源:CategoriesComposer.php

示例2: post

 public function post()
 {
     if (IS_POST) {
         $data = json_decode(Request::post('keyword'), TRUE);
         $data['rank'] = $data['istop'] == 1 ? 255 : min(255, intval($data['rank']));
         $data['module'] = v('module.name');
         $data['keywords'] = $data['keyword'];
         $rid = service('WeChat')->rule($data);
         //调用模块的执行方法
         $module = new $this->moduleClass();
         //字段验证
         if ($msg = $module->fieldsValidate($rid)) {
             message($msg, 'back', 'error');
         }
         //使模块保存回复内容
         $module->fieldsSubmit($rid);
         message('规则保存成功', u('post', ['rid' => $rid, 'm' => v('module.name')]));
     }
     //获取关键词回复
     if ($rid = Request::get('rid')) {
         $data = Db::table('rule')->find($rid);
         if (empty($data)) {
             message('回复规则不存在', 'back', 'error');
         }
         $data['keyword'] = Db::table('rule_keyword')->orderBy('id', 'asc')->where('rid', $rid)->get();
         View::with('rule', $data);
     }
     $module = new $this->moduleClass();
     $moduleForm = $module->fieldsDisplay($rid);
     return view()->with('moduleForm', $moduleForm);
 }
开发者ID:houdunwang,项目名称:hdcms,代码行数:31,代码来源:Reply.php

示例3: weixin

 /**
  * 支付
  *
  * @param $param
  */
 public function weixin($param)
 {
     if (!v('module.name') || !Session::get('member.uid') || empty($param['goods_name']) || empty($param['fee']) || empty($param['body']) || empty($param['tid'])) {
         message('支付参数错误,请重新提交', 'back', 'error');
     }
     if ($pay = Db::table('pay')->where('tid', $param['tid'])->first()) {
         if ($pay['status'] == 1) {
             message('定单已经支付完成', $param['back_url'], 'success');
         }
     }
     $data['siteid'] = SITEID;
     $data['uid'] = Session::get('member.uid');
     $data['tid'] = $param['tid'];
     $data['fee'] = $param['fee'];
     $data['goods_name'] = $param['goods_name'];
     $data['attach'] = isset($param['attach']) ? $param['attach'] : '';
     //附加数据
     $data['module'] = v('module.name');
     $data['body'] = $param['body'];
     $data['attach'] = $param['attach'];
     $data['status'] = 0;
     $data['is_usecard'] = isset($param['is_usecard']) ? $param['is_usecard'] : 0;
     $data['card_type'] = isset($param['card_type']) ? $param['card_type'] : '';
     $data['card_id'] = isset($param['is_usecard']) ? $param['card_id'] : 0;
     $data['card_fee'] = isset($param['card_fee']) ? $param['card_fee'] : 0;
     if (empty($pay)) {
         Db::table('pay')->insertGetId($data);
     }
     Session::set('pay', ['tid' => $data['tid'], 'module' => v('module.name'), 'siteid=' => SITEID]);
     View::with('data', $data);
     View::make('server/build/template/pay.html');
 }
开发者ID:houdunwang,项目名称:hdcms,代码行数:37,代码来源:Pay.php

示例4: doWebLists

 public function doWebLists()
 {
     $Model = new CreditsRecord();
     //会员信息
     $user = Db::table('member')->where('uid', Session::get('member.uid'))->first();
     if ($timerange = q('get.timerange')) {
         //有筛选时间的
         $timerange = explode('至', $timerange);
         $total = $Model->where('uid', Session::get('member.uid'))->where('credittype', q('get.type'))->where('createtime', '>=', strtotime($timerange[0]))->where('createtime', '<=', strtotime($timerange[1]))->count();
         $page = Page::row(8)->make($total);
         $data = $Model->where('uid', Session::get('member.uid'))->where('credittype', q('get.type'))->where('createtime', '>=', strtotime($timerange[0]))->where('createtime', '<=', strtotime($timerange[1]))->limit(Page::limit())->get();
     } else {
         $total = $Model->where('uid', Session::get('member.uid'))->where('credittype', q('get.type'))->count();
         $page = Page::row(8)->make($total);
         $data = $Model->where('uid', Session::get('member.uid'))->where('credittype', q('get.type'))->limit(Page::limit())->get();
     }
     //收入
     $income = $Model->where('num', '>', 0)->where('uid', Session::get('member.uid'))->where('credittype', q('get.type'))->sum('num');
     //支出
     $expend = $Model->where('num', '<', 0)->where('uid', Session::get('member.uid'))->where('credittype', q('get.type'))->sum('num');
     View::with(['income' => $income, 'expend' => $expend]);
     View::with('page', $page);
     View::with('user', $user);
     View::with('data', $data);
     View::make($this->ucenter_template . '/credit_lists.html');
 }
开发者ID:houdunwang,项目名称:hdcms,代码行数:26,代码来源:credit.php

示例5: run

 public function run()
 {
     //分配表单验证数据
     View::with('errors', Session::flash('errors'));
     //清除闪存
     Session::flash('[del]');
 }
开发者ID:houdunwang,项目名称:hdphp,代码行数:7,代码来源:App.php

示例6: index

 public function index()
 {
     //商品分类
     $cate = new \Home\Model\Cate();
     $cateData = $cate->getChan();
     // p($cateData);
     View::with('cateData', $cateData);
     //创建商品对象
     $goods = new \Home\Model\Goods();
     //最新发布商品
     $new = $goods->getNew();
     View::with('new', $new);
     //重组分类列表,并去取出8件商品
     $cateTree = $cateData;
     foreach ($cateData as $k => $v) {
         $a = array();
         //取该分组下的三级分类
         foreach ($v['_data'] as $m => $n) {
             $a = array_merge($a, array_keys($n['_data']));
         }
         unset($cateTree[$k]['_data']);
         $cateTree[$k]['three'] = $a;
         if ($a) {
             $level_goods = $goods->whereIn('cate_id', $a)->limit(8)->get();
             $cateTree[$k]['level_goods'] = $level_goods;
         }
     }
     // p($cateTree);
     View::with('cateTree', $cateTree);
     View::make($this->tpl . 'index.html');
 }
开发者ID:ChenHuaPHP,项目名称:ZOLshop,代码行数:31,代码来源:IndexController.php

示例7: moduleBrowser

 public function moduleBrowser()
 {
     service('user')->loginAuth();
     View::with('modules', v('site.modules'));
     View::with('useModules', explode(',', q('get.mid', '', [])));
     return view();
 }
开发者ID:houdunwang,项目名称:hdcms,代码行数:7,代码来源:Component.php

示例8: compose

 /**
  * Attach required data to Dashboard Menus view.
  * 
  * @param  View $view
  * @return void
  */
 public function compose($view)
 {
     $routes = $this->getAllRoutes();
     $partials = $this->getDropdownPartials();
     $pages = $this->getPages();
     $view->with('routes', $routes)->with('partials', $partials)->with('pages', $pages);
 }
开发者ID:onlystar1991,项目名称:mtdb,代码行数:13,代码来源:DashMenusComposer.php

示例9: compose

 public function compose(View $view)
 {
     $tags = Tag::orderBy('id', 'DESC')->get();
     $categories = Category::orderBy('id', 'DESC')->simplepaginate(7);
     $images = Image::orderBy('id', 'DESC')->paginate(4);
     $view->with('tags', $tags)->with('categories', $categories)->with('images', $images);
 }
开发者ID:EstevenJaviier,项目名称:Semillero-IN,代码行数:7,代码来源:AsideComposer.php

示例10: doSiteSitePost

 public function doSiteSitePost()
 {
     if (IS_POST) {
         $data = json_decode($_POST['data'], TRUE);
         $data['site_info'] = $_POST['data'];
         $insertId = $this->web->save($data);
         $web['id'] = $this->webid ?: $insertId;
         //添加回复规则
         $rule = [];
         $rule['rid'] = Db::table('reply_cover')->where('web_id', $web['id'])->pluck('rid');
         $rule['module'] = 'cover';
         $rule['name'] = '微站:' . $data['title'];
         $rule['keywords'] = [['content' => $data['keyword']]];
         $rid = service('WeChat')->rule($rule);
         //添加封面回复
         $replyCover = new ReplyCover();
         $replyCover->where('rid', $rid)->delete();
         $data['web_id'] = $web['id'];
         $data['rid'] = $rid;
         $data['module'] = 'article';
         $data['url'] = '?a=entry/home&m=article&t=web&siteid=' . SITEID . '&webid=' . $web['id'];
         $replyCover->save($data);
         message('保存站点数据成功', site_url('site'), 'success');
     }
     if ($this->webid) {
         //编辑数据时
         $web = $this->web->find($this->webid);
         $field = json_decode($web['site_info'], TRUE);
         $field['id'] = $this->webid;
     }
     View::with('field', isset($field) ? json_encode($field, JSON_UNESCAPED_UNICODE) : '');
     return View::make($this->template . '/manage/sitePost.php');
 }
开发者ID:houdunwang,项目名称:hdcms,代码行数:33,代码来源:manage.php

示例11: index

 public function index()
 {
     $id = Q('pid');
     $node = new \Admin\Model\Node();
     $node = $node->getchannletree();
     $access = (array) $this->db->getAccessNode($id);
     View::with('node', $node)->with('access', $access)->make();
 }
开发者ID:arnold1119,项目名称:cms,代码行数:8,代码来源:AccessController.php

示例12: doWebEmploy

 public function doWebEmploy()
 {
     $tid = q('get.tid', 0, 'intval');
     //会员卡卷记录
     $ticket = Db::table('ticket')->where('tid', $tid)->first();
     View::with('ticket', $ticket);
     View::make($this->ucenter_template . '/ticket_employ.html');
 }
开发者ID:houdunwang,项目名称:hdcms,代码行数:8,代码来源:ticket.php

示例13: pay

 public function pay()
 {
     //分配模板文件配置
     $tplData['title'] = "在线支付";
     $tplData['css'] = "cart|pay";
     View::with('tplData', $tplData);
     View::make($this->tpl . 'pay.html');
 }
开发者ID:ChenHuaPHP,项目名称:ZOLshop,代码行数:8,代码来源:OrderController.php

示例14: run

 public function run()
 {
     //分配表单验证数据
     $errors = \Session::flash('validate');
     \View::with('errors', $errors);
     //清除闪存
     \Session::flash('[del]');
 }
开发者ID:houdunwang,项目名称:hdcms,代码行数:8,代码来源:AppStart.php

示例15: doWebShow

 public function doWebShow()
 {
     $id = q('get.id', 0, 'intval');
     $article = Db::table('reply_news')->where('id', $id)->first();
     $tpl = __TEMPLATE__ . '/article.html';
     View::with('hdcms', $article);
     return view($tpl);
 }
开发者ID:houdunwang,项目名称:hdcms,代码行数:8,代码来源:site.php


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