Yes.
Usually when I do this I usually create a Peer method that constructs
an array of the values that I care about and then return that array to
the action, which passes that to the template for display. Such as:
class BlaPeer extends BaseBlaPeer {
public static function getImportantBlaData()
{
$c = new Criteria();
....
$rs = self::doSelectRS($c);
$ret = array();
while ($rs->next()) {
$ret[] = array( 'id' => $rs->getInt(1),
'fromAddr' => $rs->getString(2),
'subject' => $rs->getString(3),
'spamPercent' => $rs->getInt(4),
'createdAt' => $rs->getTimestamp(5,
"m/d/y H:i"),
'status' =>
Status::getName($rs->getInt(6)),
);
}
return $ret;
}
}
This allows you to reuse the method and better follows the MVC model.
jbw
On 5/31/07, Greg Freeman <[EMAIL PROTECTED]> wrote:
>
> Thank you both for the assistance!
>
> In my template do I use
>
> while($rs->next())
> {
> ...
> }
>
> to loop over the result set? since im using doSelectRS
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---