【发布时间】:2014-11-29 22:40:09
【问题描述】:
过去 2 年我一直在开发 codeigniter 应用程序,自从我从 codeigniter 本身开始我的 mvc 模式样式以来,现在我不是一个重度命令行用户,所以起初我确实有一些使用 codeigniter 的学习曲线,但我越过了它并且开始使用 code igniter 开发应用程序,因为我们不需要进行很多配置,所有内容都在一个 zip 文件中,但现在不幸的是 codeigniter 已经死了,我只是我团队中的一个人,我不得不依赖其他第三方工具受到其他人的信任,所以我决定改用laravel,现在开始时很难从codeigniter迁移,因为composer和其他所有东西,但不知何故我也越过了,但我现在对路由和其他东西感到困惑和我尝试了很多教程,但我仍然看不到如何从我管理学生的应用程序迁移,他们可以更改电子邮件,更改电话号码更新的东西,在 codeigniter 中这很容易,但我不如何在路由中处理这些东西laravel,现在这个问题对于已经在使用 laravel 的社区来说听起来很愚蠢,但如果你从我的角度来看,它会影响我的面包和黄油。这就是我在codeigniter中使用的方法
class Student extends CI_Controller{
// usual piece of code of constructor
function update_email()
{
// piece of code to update email
}
}
但是现在有了 laravel 路由系统,我不知道如何处理这个资源控制器看起来像这样
<?php
class StudentController extends \BaseController {
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
}
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store()
{
//
}
/**
* Display the specified resource.
*
* @param int $id
* @return Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function update($id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
//
}
}
现在每个部分都还可以,但是我该如何处理我只需要更新电子邮件地址或只更新电话号码等的事情
【问题讨论】:
标签: php codeigniter laravel laravel-4 laravel-routing