dongzhuo3059 2011-08-09 09:07
浏览 11
已采纳

实现自定义yii模型

I'd like to use a set of DBF files as my yii app's database. Please suggest a documentation for implementing custom models in yii framework?

  • 写回答

1条回答 默认 最新

  • douguachan2879 2011-08-09 20:58
    关注

    It partly depends on if you are going to use it as the only database or want to support multiple databases. If it's your only database and assuming you have the PDO driver, you can set up your database connection in the Yii config/main.php file. I don't believe it would support Active Record, however, so as @ktothez mentioned, you might be better off importing it to a database that does.

    If you want to support multiple databases and have the PDO driver, you can set a new database connection via CDbConnection.

    Otherwise you could simply make your own custom class and deal with it that way by fetching your custom data, storing in an array and then use Yii's array functions instead of AR functions.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 ikuai客户端l2tp协议链接报终止15信号和无法将p.p.p6转换为我的l2tp线路
  • ¥15 经gamit解算的cors站数据再经globk网平差得到的坐标做形变分析
  • ¥15 GD32 SPI通信时我从机原样返回收到的数据怎么弄?
  • ¥15 phython读取excel表格报错 ^7个 SyntaxError: invalid syntax 语句报错
  • ¥20 @microsoft/fetch-event-source 流式响应问题
  • ¥15 ogg dd trandata 报错
  • ¥15 高缺失率数据如何选择填充方式
  • ¥50 potsgresql15备份问题
  • ¥15 Mac系统vs code使用phpstudy如何配置debug来调试php
  • ¥15 目前主流的音乐软件,像网易云音乐,QQ音乐他们的前端和后台部分是用的什么技术实现的?求解!