0
我已經創建了一個插入的程序,但不知道如何調用參數「名」和「路徑」,在控制器和模型傳遞參數4
存儲過程:
CREATE DEFINER=`root`@`localhost`
PROCEDURE `insert_document_details`
(IN `name` VARCHAR(50), IN `path` VARCHAR(255))
BEGIN
INSERT INTO `document_details`
(`document_name`, `document_path`)
VALUES (name,path);
END
路線:
Route::post('insert_document_details/{name}/{path}',array('as'=>'insert_document_details',
'uses'=>'[email protected]_document_details'));
AuthorController:
class AuthorsController extends BaseController{
public $restful = true;
public function post_document_details($name,$path)
{
$document_details=Response::json(Author::insert_document_details_Call());
return $document_details;
}
}
作者(模型):
class Author extends Eloquent {
public $table = 'document_details';
protected $primaryKey = 'id';
public static function insert_document_details_Call($name,$path)
{
return DB::select('call insert_document_details');
}
}