当前位置:网站首页>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}}边栏推荐
- Laravel framework operation error: no application encryption key has been specified
- 2022建筑焊工(建筑特殊工种)特种作业证考试题库及在线模拟考试
- 法国学者:最优传输理论下对抗攻击可解释性探讨
- Win10 - lightweight gadget
- Kotlin collaboration uses coroutinecontext to implement the retry logic after a network request fails
- 内网穿透工具 netapp
- leetcode 10. Regular Expression Matching 正则表达式匹配 (困难)
- PostgreSQL Usage Summary (PIT)
- How to deal with the Yellow Icon during the installation of wampserver
- Requests + BS4 crawl Douban top250 movie information
猜你喜欢
随机推荐
Usage, installation and use of TortoiseSVN
鏈錶(簡單)
Assembly language - Beginner's introduction
Pancake Bulldog robot V2 (code optimized)
Can graduate students not learn English? As long as the score of postgraduate entrance examination English or CET-6 is high!
面试官灵魂拷问:为什么代码规范要求 SQL 语句不要过多的 join?
这18个网站能让你的页面背景炫酷起来
The real king of caching, Google guava is just a brother
Aspx simple user login
ZABBIX monitoring
Attack and defense world crypto WP
Etcd database source code analysis -- rawnode simple package
MySQL get time
Elfk deployment
Selenium crawls Baidu pictures
Prefix, infix, suffix expression "recommended collection"
Log4j utilization correlation
Laravel generate entity
Primary code audit [no dolls (modification)] assessment
Embedded software architecture design - message interaction








