当前位置:网站首页>Laravel - view (new and output views)
Laravel - view (new and output views)
2022-07-05 13:54:00 【Weichi Begonia】
1. How to create a new view ?
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class MemberController extends Controller
{
public function info(Request $request, $id){
return view('member/info'); // The view file corresponds to resource/views/memeber Under the info.blade.php file
}
}
2. How to pass parameters to the view ? - stay view Use braces to get controller Parameters of transmission
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class MemberController extends Controller
{
public function info(Request $request, $id){
return view('member/info', [
'name'=>"tom",
"age"=>18,
]);
}
}
views Defined in the :info.blade.php
info-blade view
{
{$name}}
{
{$age}}边栏推荐
- 2022 construction welder (special type of construction work) special operation certificate examination question bank and online simulation examination
- 几款分布式数据库的对比
- [js] basic syntax - for loop
- Requests + BS4 crawl Douban top250 movie information
- asp. Net read TXT file
- 这18个网站能让你的页面背景炫酷起来
- What are the private addresses
- Godson 2nd generation burn PMON and reload system
- 【公开课预告】:视频质量评价基础与实践
- Catch all asynchronous artifact completable future
猜你喜欢

Laravel框架运行报错:No application encryption key has been specified

Elfk deployment

【公开课预告】:视频质量评价基础与实践

Mmseg - Mutli view time series data inspection and visualization

深拷贝真难
![Primary code audit [no dolls (modification)] assessment](/img/b8/82c32e95d1b72f75823ca91c97138e.jpg)
Primary code audit [no dolls (modification)] assessment

Data Lake (VII): Iceberg concept and review what is a data Lake

:: ffff:192.168.31.101 what address is it?

Jasypt configuration file encryption | quick start | actual combat

Redis6 transaction and locking mechanism
随机推荐
Rk3566 add LED
Zhubo Huangyu: it's really bad not to understand these gold frying skills
uplad_ Labs first three levels
Summit review | baowanda - an integrated data security protection system driven by compliance and security
The real king of caching, Google guava is just a brother
常见问题之PHP——Fatal error: Allowed memory size of 314572800 bytes exhausted...
Apicloud studio3 WiFi real machine synchronization and WiFi real machine preview instructions
Basic characteristics and isolation level of transactions
[MySQL usage Script] catch all MySQL time and date types and related operation functions (3)
The development of speech recognition app with uni app is simple and fast.
Pancake Bulldog robot V2 (code optimized)
面试官灵魂拷问:为什么代码规范要求 SQL 语句不要过多的 join?
Resttemplate details
Jasypt configuration file encryption | quick start | actual combat
Log4j utilization correlation
锚点导航小demo
[South China University of technology] information sharing of postgraduate entrance examination and re examination
Mmseg - Mutli view time series data inspection and visualization
MySQL if else use case use
嵌入式软件架构设计-消息交互