On 20 Jul 2009, at 09:35, Felix Gilcher wrote:
>> On 19 Jul 2009, at 16:17, David Zülke wrote:
>>>> I'm thinking about using routing callbacks on an upcoming projects,
>>>> together with caching. I see at 
>>>> http://www.agavi.org/documentation/tutorial/step4/routing-callbacks.html
>>>> that onMatched can modify parameters extract to the route. So I  
>>>> have
>>>> a good understanding of this and caching...
>>>>
>>>> - If using such a parameter in the source for a caching group, is  
>>>> the
>>>> source taken to be the parameter before or after the modification  
>>>> by
>>>> the callback?
>>>
>>> After.
>>
>> So does this mean that  onMatched is always called, no matter of the
>> cache settings? In onMatched I was hoping to convert a "nice" product
>> url alias into a product record instance to pass to the action(s).
>> This would require a database query that I was hoping to avoid with
>> some caching.
>>
>> It is possible to both use caching and onMatched in this way, or  
>> would
>> I have to forgo using callbacks/onMatched and query the database
>> within the action itself?
>
> The standard way would be to handle that in the validation. The  
> validator has to confirm that the given product id is a valid  
> product id so it has to hit that database anyways. It can export the  
> instance into the request data by using the AgaviValidator::export().

I didn't think of using validation to do this. Thanks!

Michal.
_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users

Reply via email to