php 把对象实例化当作参数传到宁外一个类
include("classes/db.php");include("model/booksModel.php");include("view/view.php");$d...
include("classes/db.php");
include("model/booksModel.php");
include("view/view.php");
$db = new db("localhost","root","123456","bk");
$oBook = new Books;
$booksModel = new BooksModel($db);
$view = new BookView($booksModel);
为什么要把实例化的对象当作参数传到宁外一个类呢,这样写的原因是什么,记得老师以前说过。当时没体会到 展开
include("model/booksModel.php");
include("view/view.php");
$db = new db("localhost","root","123456","bk");
$oBook = new Books;
$booksModel = new BooksModel($db);
$view = new BookView($booksModel);
为什么要把实例化的对象当作参数传到宁外一个类呢,这样写的原因是什么,记得老师以前说过。当时没体会到 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询