Laravel 5
遍历数组@foreach($brand as $v)
<a href='/brandss/seeshops?id={{$v->id}}'><img src="/public{{$v->image}}" style="height: 300px;width: 300px"></a></img>
<a href="/brandss/seeshops?id={{$v->id}}">{{$v->brandName}}</a>
@endforeach
============
============
数据库查询:
$cates = DB::table('tp_article')->where('odds','=', $pid)->get();
public static function getCatesByDiGui($pid)
{
//获取分类
// return 'sss';
$cates = DB::table('tp_article')->where('odds','=', $pid)->get();
//遍历分类信息
var_dump($cates);
exit;
// $cates = DB::table('tp_article')->where('odds','=', '$pid')->get();
$sub_cate = [];
foreach($cates as $k=>$v) {
$v->sub_cate = self::getCatesByDiGui($v->id);
$sub_cate[] = $v;
}
return $sub_cate;
}
Laravel 5的更多相关文章
- TODO:Laravel增加验证码
TODO:Laravel增加验证码1. 先聊聊验证码是什么,有什么作用?验证码(CAPTCHA)是"Completely Automated Public Turing test to te ...
- TODO:Laravel 内置简单登录
TODO:Laravel 内置简单登录 1. 激活Laravel的Auth系统Laravel 利用 PHP 的新特性 trait 内置了非常完善好用的简单用户登录注册功能,适合一些不需要复杂用户权限管 ...
- TODO:Laravel 使用blade标签布局页面
TODO:Laravel 使用blade标签布局页面 本文主要介绍Laravel的标签使用,统一布局页面.主要用到到标签有@yield,@ stack,@extends,@section,@stop, ...
- TODO:搭建Laravel VueJS SemanticUI
TODO:搭建Laravel VueJS SemanticUI Laravel是一套简洁.优雅的PHP开发框架(PHP Web Framework).可以让你从面条一样杂乱的代码中解脱出来:它可以帮你 ...
- Bringing Whoops Back to Laravel 5
You might be missing the "prettier" Whoops error handler from Laravel 4. If so, here's how ...
- 在 Laravel 中使用图片处理库 Integration/Image
系统需求 PHP >= 5.3 Fileinfo Extension GD Library (>=2.0) … or … Imagick PHP extension (>=6.5.7 ...
- Laravel Composer and ServiceProvider
Composer and: 创建自定义类库时,按命名空间把文件夹结构组织好 composer.json>autoload>classmap>psr-4 composer dump-a ...
- Laravel 5.x 请求的生命周期(附源码)
Laravel最早接触是刚开始实习的时候,那时通过网上的学习资料很快便上手,开发模块接口.后来没有什么深入和总结,但是当我刚开始学Laravel的时候,我对Laravel最大的认识就是,框架除了路由. ...
- Laravel 5.3 登录注册底层实现详解
每个控制器都使用 trait 来引入它们需要的方法 */ 用于处理用户登录认证 用于处理新用户注册 包含重置密码逻辑 用于处理重置密码邮件链接 认证需要的视图 包含了应用的基础布局文件 ...
- Laravel - 安装与配置
有多重途径可以安装Laravel,下面是通过composer安装laravel的方法.Composer 是 PHP 的一个依赖管理工具.它允许你申明项目所依赖的代码库,它会在你的项目中为你安装他们.c ...
随机推荐
- Flume 读取JMS 消息队列消息,并将消息写入HDFS
利用Apache Flume 读取JMS 消息队列消息.并将消息写入HDFS,flume agent配置例如以下: flume-agent.conf #name the components on ...
- TensorFlow Lite demo——就是为嵌入式设备而存在的,底层调用NDK神经网络API,注意其使用的tf model需要转换下,同时提供java和C++ API,无法使用tflite的见后
Introduction to TensorFlow Lite TensorFlow Lite is TensorFlow’s lightweight solution for mobile and ...
- Java插入中文到数据库中文变成问号解决
转自:https://blog.csdn.net/hellosweet1/article/details/81673152 之所以会出现乱码,就是编码方式不一致导致的 我们应该首先确定 ...
- 一个豆瓣 API 的反向代理配置,旨在解决豆瓣屏蔽小程序请求问题(豆瓣接口 403 问题)
#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #erro ...
- C# 获取当月有多少天
int days = DateTime.DaysInMonth ( 2009, 9 ); int days = DateTime.DaysInMonth ( DateTime.Now.Year, Da ...
- Redis(六)-数据类型
Redis支持五种数据类型:string(字符串),hash(哈希),list(列表),set(集合)及zset(sorted set:有序集合). String(字符串) string是redis最 ...
- js仿新浪游戏频道导航条
js仿新浪游戏频道导航条 在线演示本地下载
- Android 微博sdk接入授权指南
1:首先在微博官方注册账号,官方地址是:http://open.weibo.com/然后创建一个新应用. 2:当然我们得现在自己电脑上创建一个应用,例如包名叫com.winorout.weib ...
- Embedded之Stack之一
1 Intro When a program starts executing, a certain contiguous section of memory is set aside for the ...
- Type inference
Type inference refers to the automatic detection of the data type of an expression in a programming ...