Your need for a "user top list" could be something like this
public class TopUsersComponent : ViewComponent
{
private readonly IUserService userService;
public TopUsersComponent(IUserService userService)
{
this.userService = userService;
}
[ViewComponentParam]
public string NumberOfUsers { get; set; }
public override void Initialize()
{
PropertyBag["viewmodel.Top10Users"] =
userService.GetTopUsers(NumberOfUsers);
base.Initialize();
}
}
In the view/layout (spark):
<TopUsers NumberOfUsers="10" />
or brail:
<% component TopUsersComponent, {...@numberofusers:'10'} %>
So your layout can look something like this:
<html>
<head>...
<body>
<TopUsers NumberOfUsers="10" />
<h1>bla bla</h1>
....
<StockQuotes>
On Tue, Aug 18, 2009 at 5:11 PM, R. Rajesh Jeba Anbiah <
[email protected]> wrote:
>
> On Aug 18, 7:10 pm, Martin Nilsson <[email protected]> wrote:
> > That's how they solved it in Asp.Net Mvc (to use a controller) but in
> > Monorail it's viewcomponents. You can still use parameters, dependencies,
> > domain model etc in your view components.
> >
> > What is it you want to do that you don't think you can do with a view
> > component?
>
> May be. But, I don't find such usage anywhere. It looks like a piece
> of view without controller & model processing. TIA
>
> --
> <?php echo 'Just another PHP saint'; ?>
> Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project 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/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---