Yii pagination samples ?
Posted 06 October 2008 - 11:10 AM
First off thanks for continuing to produce high quality frameworks. I know from my experience with prado this will also be a powerful tool for any web developer. A couple of quick questions -
1) Can some CPagination samples be added to the definitive guide (pardon me if I missed it) ?
2) How would prados' sqlmap operations translate to this framework ? Would it simply be something like
Or would another method be better ?
3) Are active record relations still dependent on established database relations (ie does the table need to be defined with the foreign keys) ?
Posted 06 October 2008 - 11:55 AM
1). If you try the "crud" command with yiic, you will find that the generated code already uses CPagination. Please follow the description in "Creating First Application" in the Guide to see how to use yiic crud command.
2). Yii comes with DAO and Active Record as Prado does. Both are completely rewritten and made cleaner and more efficient. SQLMap is not in Yii due to the fact that it is overly complicated. In fact, we are thinking about a way to unify Active Record and SQLMap, which may be realized in v1.1 release. The code snippet you gave is about using DAO, which is available in both Yii and PRADO.
3). As a matter of fact, AR does not really require relationship definition in DBMS except for MANY_MANY relationship. Currently, AR needs DBMS relationship mainly for sanity checking purpose, i.e., if you do not declare relation in AR class correctly, it will tell you where the error is.
Posted 06 October 2008 - 01:16 PM
Thanks, the code that was generated from the example application answered a lot of my questions - although there seemed to have been an issue about the login page not being found (http://localhost/tes...hp?r=user/login) - But I was able to work through by commenting access control out in the controller ...
Posted 06 October 2008 - 02:03 PM