| Author |
Message |
|
| ketralnis |
Posted: Sat Nov 24, 2007 5:53 am |
|
|
|
User
Joined: 20 Jul 2007
Posts: 151
Location: San Francisco, CA
|
> So, instead of returning
>
> {with_phased_vars,
> [{title, "foo"},
> {meta, "bar"}],
> {ewc, navbar, [A]}}
>
> you would return
>
> {response,
> [{phased_vars,
> [{title, "foo"},
> {meta, "bar"}],
> {body, {ewc, navbar, [A]}}]}.
How does that stack? How would I return two {ewc}s? Like this?:
{response,
[{phased_vars,
[{title, "foo"},
{meta, "bar"}],
{body, [{ewc, navbar, [A]}
{ewc, cookies, [A, cookies:find()]}]}]}.
It looks good though; if I'm returning phased values like that, I'm
probably setting headers and whatnot, since I'm probably the initial
{ewc}. The only problem is that only initial {ewc}s can do it, not
nested ones (unless there are many levels of {phased,ewc...}). That's
fine for my purposes, but I don't know about most people.
>
> The 'response' tuple already lets you return values that aren't passed
> to the view function. I think we should reuse it.
>
> What do you think?
>
> Yariv
>
>
>
> On Nov 17, 2007 6:35 PM, David King <dking@ketralnis.com> wrote:
>>
>>> Yeah, I agree. I think 'with_properties' and 'set_properties' sounds
>>> too generic, though. Maybe 'with_meta_vals' or 'with_phased_vals'?
>>
>> I like with_phased_vals, that's relatively clear
>>
>>
>>>
>>
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---
Post recived from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Sat Nov 24, 2007 10:32 pm |
|
|
|
Guest
|
> How does that stack? How would I return two {ewc}s? Like this?:
>
> {response,
> [{phased_vars,
> [{title, "foo"},
> {meta, "bar"}],
> {body, [{ewc, navbar, [A]}
> {ewc, cookies, [A, cookies:find()]}]}]}.
>
> It looks good though; if I'm returning phased values like that, I'm
> probably setting headers and whatnot, since I'm probably the initial
> {ewc}. The only problem is that only initial {ewc}s can do it, not
> nested ones (unless there are many levels of {phased,ewc...}). That's
> fine for my purposes, but I don't know about most people.
This limitation seems resonable to me too. The main need for the
phased_vars feature is being able to set title, headers, etc, and
those are for the most part determined by the top level ewc, not its
subcomponents. If at some point we realize this is insufficient we can
do the work to remove this limitation, but for now I think it strikes
the best balance between features and ease of implementation.
Yariv
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---
Post recived from mailinglist |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|
|