Can I use CActiveDataProvider?

278 views
Skip to first unread message

Riccardo Coppola

unread,
Mar 11, 2012, 6:49:13 PM3/11/12
to yiimong...@googlegroups.com
Hi,
I'm trying to get a zii.widgets.grid.CGridView to work with a CActiveDataProvider from a mongo model (User), but it fails with the error

User and its behaviors do not have a method or closure named "tableName"

My code in the controller class is very easy:

$dataProvider = new CActiveDataProvider('User');

With User being my model class.

Since the EmongoDocument class doesn't implement all the methods implemented by CActiveRecord, this error is normal, but I've read somewhere that I can use CActiveDataProvider with YiiMongoDBSuite.
Am I doing something wrong?
Is there a way to get zii widgets that require a DataProvider to work? How?

Thanks for your time,

Riccardo

Zheng Gui

unread,
Mar 11, 2012, 6:55:09 PM3/11/12
to yiimongodbsiute
You want to use EMongoDocumentDataProvider.
 
 
2012-03-12

Zheng Gui

发件人: Riccardo Coppola
发送时间: 2012-03-12  06:49:15
收件人: yiimongodbsiute
抄送:
主题: [ymds] Can I use CActiveDataProvider?

Riccardo Coppola

unread,
Mar 12, 2012, 4:33:21 AM3/12/12
to yiimong...@googlegroups.com
Perfect,
I'll give it a try.

Thank you for your reply,
Riccardo

Il giorno domenica 11 marzo 2012 23:55:09 UTC+1, Zheng ha scritto:


Riccardo Coppola

unread,
Mar 16, 2012, 6:23:09 AM3/16/12
to yiimong...@googlegroups.com
It works,
Thank you.
Reply all
Reply to author
Forward
0 new messages