免费国产欧美国日产_少妇AV一区二区三区无码_蜜桃精品av无码喷奶水小说_jk18禁网站视频_精产国品一二三级产品区别_被夫の上司に犯波多野结衣_78m成人手机免费看_最爽最刺激18禁视频_偷偷色噜狠狠狠狠的777米奇

創(chuàng)建類庫文件

快速生成控制器類

執(zhí)行下面的指令可以生成index模塊的Blog控制器類庫文件

>php think make:controller index/Blog

生成的控制器類文件如下:

<?php

namespace app\index\controller;

use think\Controller;
use think\Request;

class Blog extends Controller
{
    /**
     * 顯示資源列表
     *
     * @return \think\Response
     */
    public function index()
    {
        //
    }

    /**
     * 顯示創(chuàng)建資源表單頁.
     *
     * @return \think\Response
     */
    public function create()
    {
        //
    }

    /**
     * 保存新建的資源
     *
     * @param  \think\Request  $request
     * @return \think\Response
     */
    public function save(Request $request)
    {
        //
    }

    /**
     * 顯示指定的資源
     *
     * @param  int  $id
     * @return \think\Response
     */
    public function read($id)
    {
        //
    }

    /**
     * 顯示編輯資源表單頁.
     *
     * @param  int  $id
     * @return \think\Response
     */
    public function edit($id)
    {
        //
    }

    /**
     * 保存更新的資源
     *
     * @param  \think\Request  $request
     * @param  int  $id
     * @return \think\Response
     */
    public function update(Request $request, $id)
    {
        //
    }

    /**
     * 刪除指定資源
     *
     * @param  int  $id
     * @return \think\Response
     */
    public function delete($id)
    {
        //
    }
}

默認生成的控制器類繼承\think\Controller ,并且生成了資源操作方法,如果僅僅生成空的控制器則可以使用:

>php think make:controller index\Blog --plain

快速生成模型類

執(zhí)行下面的指令可以生成index模塊的Blog模型類庫文件

>php think make:model index/Blog

生成的模型類文件如下:

namespace app\index\model;

use think\Model;

class Blog extends Model
{

}
文檔最后更新時間:2018-04-26 11:01:52

文檔
目錄

深色
模式

切換
寬度