当前位置:网站首页>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}}边栏推荐
- PHP generate Poster
- Matlab learning 2022.7.4
- [public class preview]: basis and practice of video quality evaluation
- 2022 driller (drilling) examination question bank and simulation examination
- [server data recovery] a case of RAID5 data recovery stored in a brand of server
- What is information security? What is included? What is the difference with network security?
- 几款分布式数据库的对比
- Pancake Bulldog robot V2 (code optimized)
- jasypt配置文件加密|快速入门|实战
- [machine learning notes] how to solve over fitting and under fitting
猜你喜欢

Set up a website with a sense of ceremony, and post it to the public 2/2 through the intranet

深拷贝真难

What are the private addresses

Those things I didn't know until I took the postgraduate entrance examination

Laravel framework operation error: no application encryption key has been specified

Anchor navigation demo

面试官灵魂拷问:为什么代码规范要求 SQL 语句不要过多的 join?

STM32 reverse entry

Nantong online communication group

【华南理工大学】考研初试复试资料分享
随机推荐
Prefix, infix, suffix expression "recommended collection"
Multi person cooperation project to see how many lines of code each person has written
Redis6 data type and operation summary
When there are too many input boxes such as input transmitted at one time in the form, the post data is intercepted
Datapipeline was selected into the 2022 digital intelligence atlas and database development report of China Academy of communications and communications
2022 driller (drilling) examination question bank and simulation examination
几款分布式数据库的对比
matlab学习2022.7.4
链表(简单)
Wonderful express | Tencent cloud database June issue
Pancake Bulldog robot V2 (code optimized)
常见问题之PHP——Fatal error: Allowed memory size of 314572800 bytes exhausted...
Internal JSON-RPC error. {"code":-32000, "message": "execution reverted"} solve the error
JS takes key and value from an array object to form a new object
ETCD数据库源码分析——集群间网络层客户端peerRt
[MySQL usage Script] catch all MySQL time and date types and related operation functions (3)
Elfk deployment
ZABBIX monitoring
Godson 2nd generation burn PMON and reload system
leetcode 10. Regular Expression Matching 正则表达式匹配 (困难)