thinkphp5 controller cannot pass value mdoel
HAO
HAO 2018-03-09 20:17:23
0
2
1226

<?php
namespace app\admin\controller;
use app\model\Admin;
use think\Controller;
class Login extends Controller
{
public function login()
                                                                                                                                                                                                  Received data passed to the model layer Model
$ res = (new admin ())-& gt; login (input ('post.'));
}
Return $ This- & gt; fetch () ;
}
}



<?php

namespace app\model;
use think\Loader;

use think\ Model;

class Admin extends Model{

public function login($data){

halt($data);
}
}

?>

HAO
HAO

reply all(2)
郭骏博

Why not use the helper function model(Admin)->login();

lge

Is there any error report or prompt


Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template