laravel5 路由配置 技巧
2015-11-13 16:15
1026 查看
为控制器的每个方法生成一个路由太麻烦了,
方法1、
访问 http://localhost:8000/demos/index
方法1、
Route::controller('demos', 'Demo2Controller');
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Http\Requests; use App\Http\Controllers\Controller; class Demo2Controller extends Controller { /** * Responds to requests to GET /users */ public function getIndex() { // return 1; } /** * Responds to requests to GET /users/show/1 */ public function getShow($id) { // return $id; } /** * Responds to requests to GET /users/admin-profile */ public function getAdminProfile() { // } /** * Responds to requests to POST /users/profile */ public function postProfile() { // } }
访问 http://localhost:8000/demos/index
相关文章推荐
- 初写博客--laravel与hybrid 开发的数据传输
- xp下搭建FTP服务器过程中遇到的问题
- laravel 路由无法跟踪的问题
- PHP函数补完:array_multisort()
- PHP一些常用的字符串函数
- PHP7版本改动细节整理翻译完毕
- Zend Studio使用介绍
- 开启PHP Static 关键字之旅模式
- 15个超实用的php正则表达式
- laravel安装
- 超常用的PHP正则表达式收集整理
- PHP 新建动态类的代码
- PHP一些常用的字符串函数
- (PHP)正则表达式-preg_match和preg_match_all()的用法
- php正则表达式学习笔记
- PHP请求页面
- (PHP)正则表达式-preg_replace()和preg_filter()
- PHP安全相关的配置
- EditPlus注册码 亲测最新版可用
- [Windows Server 2008] 安装PHP+MySQL方法