Yii Framework Forum: Yii pagination samples ? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Yii pagination samples ? Rate Topic: -----

#1 User is offline   notzippy 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 201
  • Joined: 06-October 08

Posted 06 October 2008 - 11:10 AM

Hi

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
$command=$connection->createCommand($sqlStatement);
$command->bindParam($name1,$value1);
$command->bindParam($name2,$value2);
$command->execute();
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) ?

Thanks again
NZ
0

#2 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,875
  • Joined: 04-October 08
  • Location:DC, USA

Posted 06 October 2008 - 11:55 AM

Welcome aboard and thank you for making the first post.

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.
0

#3 User is offline   notzippy 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 201
  • Joined: 06-October 08

Posted 06 October 2008 - 01:16 PM

Hi

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 ...

NZ


0

#4 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,875
  • Joined: 04-October 08
  • Location:DC, USA

Posted 06 October 2008 - 01:41 PM

Could you elaborate the issue about the login page? How to reproduce the issue?
0

#5 User is offline   notzippy 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 201
  • Joined: 06-October 08

Posted 06 October 2008 - 02:03 PM

I think I see the problem, The UserController generated by the web application shell gets replaced when you generate the CRUD for the "user" table because it also generates a UserController ... (It does warn you first before overwriting it.)

;D

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users