Yaf模型的使用
更新:HHH   时间:2023-1-7


E:\code\yaf_demo\application\modules\User\controllers\User.php 

showAction

$userModel = new UserModel();

echo $userModel->getUserInfo($userId);


E:\code\yaf_demo\application\models\User.php

public function getUserInfo($userId)

{

        //数据库操作

        $userDao = new Dao\UserModel();

        echo $userinfo = $userDao->getUserInfo($userId);

        //接口调用

        $userBbs = new Interfaces\BbsModel();

        echo $userBbs->getBbsInfo($userId);


        //return '用户信息:'.$userId;

   return [$userinfo,$userBbs];

}


返回web开发教程...