当前位置:网站首页>Laravel basic course routing and MVC - controller
Laravel basic course routing and MVC - controller
2022-06-26 01:22:00 【DJ Fry】
Create a new controller
stay App\Http\Controllers\ Under the new MemberController.php
<?php
namespace App\Http\Controllers;
use App\Member;
class membercontroller extends Controller
{
public function info()
{
return 'member-info';
}
}
Call the controller in the route
Route::get('member/info', '[email protected]');
Route::get('member/info1', ['uses'=>'[email protected]']);
Route:: Request mode (' request url', Controller name @ Method under controller )
Route:: Request mode (' request url',['uses'=> Controller name @ Method under controller ])
Alias :
Route:: Request mode (' request url',['uses'=> Controller name @ Method under controller ,'as'=>' Alias '])
With parameters
Route:: Request mode ('/demo/{id}',['uses'=> Controller name @ Method under controller ])
call member Pattern
return member::getmember();
The ginseng
public function info($id)
{
return'member id is '.$id;
}
// In routing
Route::get('member/{id}', ['uses'=>'[email protected]'])
->where('id','[0-9]+');
Call view
return view('member-info');
return view('member/info',['name'=>' Put a variable ']);
边栏推荐
- Establish a j-link GDB cross debugging environment for Px4
- [机缘参悟-30]:鬼谷子-内揵篇-同理心,站在对方的立场,拉近与对方的心理距离
- I2C protocol
- FIFO code implemented in C language
- Duck feeding data instant collection solution resources
- Msp430f5529lp official board (red) can not debug the problem
- Making 3D romantic cool photo album [source code attached]
- Classic interview questions: mouse drug test and Hamming code
- containerd客户端比较
- 黑盒测试 — 测试用例 之 判定表法看这一篇就够了
猜你喜欢

Optimized three-dimensional space positioning method and its fast implementation in C language

Implementation notes of least square fitting conic in stm32

【花雕体验】11 上手ESP32C3

JS reverse case: cracking login password

Dgus new upgrade: fully support digital video playback function

Endnote IEEE Transactions on industrial electronics/tie/tpel reference format template

The kth largest element in the array

DGUS新升级:全面支持数字视频播放功能

QT cmake pure C code calls the system console to input scanf and Chinese output garbled code

Handling of @charset UTF-8 warning problems during vite packaging and construction;
随机推荐
Error 65:access violation at 0x58024400: no 'read' permission
在线小工具分享(不定时更新,当前数量:2)
Is it safe for flush software to buy stocks for trading? How to open an account to buy shares
Using redis database as cache in Django
Inheritance -- holy grail mode
[机缘参悟-30]:鬼谷子-内揵篇-同理心,站在对方的立场,拉近与对方的心理距离
Idea configuration
黑盒测试 — 测试用例 之 判定表法看这一篇就够了
Sword finger offer II 096 String interleaving
mysql错误代码2003的解决办法
从查询数据库性能优化谈到redis缓存-谈一谈缓存的穿透、雪崩、击穿
Download and install flume
Android cache usage tool class
Return value is object type method call equals()
MOS管防倒灌电路设计及其过程分析
containerd客户端比较
C#线程池控制Semaphore
Making 3D romantic cool photo album [source code attached]
超详细SSM框架实现增删改查功能项目整体流程
模板引擎——FreeMarker初体验