Personally I don't necessarily follow the idea of keeping all your actions
"RESTful". If you were building a rest API then sure, but sometimes you need
to get things done.
That being said, this can still be done with a executeIndex action. Just
check within it for "group by" parameters:
public function executeIndex (sfWebRequest $request)
{
if ($request->hasParameter('group_by')
{
$this->issues_to_display = IssuesPeer::getIssuesByStatus();
}
else
{
$this->issues_to_display = IssuesPeer::getIssues();
}
}
I am being deliberately obvious here just to make the example clear. You can
pass criteria instead or any number of ways.
On Mon, Nov 1, 2010 at 10:35 PM, Stan McFarland <[email protected]> wrote:
> Hi all, hoping someone can offer some advice to a Symfony newbie.
>
> I have a issues table, with an attribute 'status_id' which links to a
> status table (an issue can have a status of new, open, closed,
> etc.) My customer wants to see a list of issues (easy - handled via
> the issue/executeIndex action) but they also want to see a list of
> issues grouped by status - in other words, a separate table of issues
> for each status type, all on one page.
>
> So I can think of several ways to do it:
>
> - add an action to the issues module called "indexByStatus" with a
> corresponding template;
> - change the index action on the status module;
> - add a new action to the status module.
>
> But what's the _right_ way? Someone told me that it was bad practice
> to add actions - that it violated the notion of RESTful interface.
>
> Any suggestions would be greatly appreciated. Thanks!
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> 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]<symfony-users%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>
--
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
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